[packages] mercurial: update to 1.7.2, refresh patches

git-svn-id: svn://svn.openwrt.org/openwrt/packages@24864 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
swalker 2011-01-01 14:05:35 +00:00
parent 4fe1850038
commit eacdb63ba2
2 changed files with 111 additions and 110 deletions

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2006-2010 OpenWrt.org # Copyright (C) 2006-2011 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -8,12 +8,13 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=mercurial PKG_NAME:=mercurial
PKG_VERSION:=1.6.2 PKG_VERSION:=1.7.2
PKG_RELEASE:=2 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://mercurial.selenic.com/release PKG_SOURCE_URL:=http://mercurial.selenic.com/release
PKG_SOURCE:=mercurial-$(PKG_VERSION).tar.gz PKG_MD5SUM:=e9e99a0a20ded8f6d9463ffb94021b12
PKG_MD5SUM:=847359d7488caf8074a69d4b87ca64d2
PKG_BUILD_DEPENDS:=python-mini PKG_BUILD_DEPENDS:=python-mini
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -29,7 +30,8 @@ define Package/mercurial
endef endef
define Package/mercurial/description define Package/mercurial/description
A fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects. A fast, lightweight Source Control Management system designed for efficient
handling of very large distributed projects.
endef endef
define Build/Compile define Build/Compile
@ -41,8 +43,8 @@ endef
define Package/mercurial/install define Package/mercurial/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/bin $(1)/usr $(CP) $(PKG_INSTALL_DIR)/bin $(1)/usr/
$(CP) $(PKG_INSTALL_DIR)/lib $(1)/usr $(CP) $(PKG_INSTALL_DIR)/lib $(1)/usr/
endef endef
$(eval $(call BuildPackage,mercurial)) $(eval $(call BuildPackage,mercurial))

View File

@ -1,67 +1,53 @@
diff -urN mercurial-1.6.2/mercurial/archival.py mercurial-1.6.2-nobz2/mercurial/archival.py --- a/mercurial/archival.py
--- mercurial-1.6.2/mercurial/archival.py 2009-01-01 00:38:33.000000000 +0100 +++ b/mercurial/archival.py
+++ mercurial-1.6.2-nobz2/mercurial/archival.py 2009-01-01 13:53:14.000000000 +0100 @@ -37,7 +37,6 @@ def tidyprefix(dest, kind, prefix):
@@ -67,8 +67,8 @@
self.fileobj.write(fname + '\000')
def __init__(self, dest, prefix, mtime, kind=''): exts = {
- self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.bz2', '.tar.gz', 'tar': ['.tar'],
- '.tgz', '.tbz2']) - 'tbz2': ['.tbz2', '.tar.bz2'],
+ self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.gz', 'tgz': ['.tgz', '.tar.gz'],
+ '.tgz']) 'zip': ['.zip'],
self.mtime = mtime }
@@ -51,7 +50,7 @@ def guesskind(dest):
def taropen(name, mode, fileobj=None): class tarit(object):
@@ -182,7 +182,6 @@ '''write archive to tar file or stream. can write uncompressed,
- or compress with gzip or bzip2.'''
+ or compress with gzip.'''
class GzipFileWithTime(gzip.GzipFile):
@@ -198,7 +197,6 @@ class fileit(object):
archivers = { archivers = {
'files': fileit, 'files': fileit,
'tar': tarit, 'tar': tarit,
- 'tbz2': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'bz2'), - 'tbz2': lambda name, mtime: tarit(name, mtime, 'bz2'),
'tgz': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'gz'), 'tgz': lambda name, mtime: tarit(name, mtime, 'gz'),
'uzip': lambda name, prefix, mtime: zipit(name, prefix, mtime, False), 'uzip': lambda name, mtime: zipit(name, mtime, False),
'zip': zipit, 'zip': zipit,
diff -urN mercurial-1.6.2/mercurial/bundlerepo.py mercurial-1.6.2-nobz2/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py
--- mercurial-1.6.2/mercurial/bundlerepo.py 2009-01-01 00:38:33.000000000 +0100 +++ b/mercurial/bundlerepo.py
+++ mercurial-1.6.2-nobz2/mercurial/bundlerepo.py 2009-01-01 13:53:59.000000000 +0100 @@ -312,7 +312,7 @@ def getremotechanges(ui, repo, other, re
@@ -13,7 +13,7 @@ cg = other.changegroup(incoming, "incoming")
else:
cg = other.changegroupsubset(incoming, revs, 'incoming')
- bundletype = other.local() and "HG10BZ" or "HG10UN"
+ bundletype = other.local() and "HG10GZ" or "HG10UN"
fname = bundle = changegroup.writebundle(cg, bundlename, bundletype)
# keep written bundle?
if bundlename:
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -7,7 +7,7 @@
from node import nullid
from i18n import _
-import os, struct, bz2, zlib, tempfile, shutil
+import os, struct, zlib, tempfile, shutil
import changegroup, util, mdiff
import localrepo, changelog, manifest, filelog, revlog, error
@@ -177,16 +177,13 @@
raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename)
elif not header.startswith("HG10"):
raise util.Abort(_("%s: unknown bundle version") % bundlename)
- elif (header == "HG10BZ") or (header == "HG10GZ"):
+ elif (header == "HG10GZ"):
fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-",
suffix=".hg10un", dir=self.path)
self.tempfile = temp
fptemp = os.fdopen(fdtemp, 'wb')
def generator(f):
- if header == "HG10BZ":
- zd = bz2.BZ2Decompressor()
- zd.decompress("BZ")
- elif header == "HG10GZ":
+ if header == "HG10GZ":
zd = zlib.decompressobj()
for chunk in f:
yield zd.decompress(chunk)
diff -urN mercurial-1.6.2/mercurial/changegroup.py mercurial-1.6.2-nobz2/mercurial/changegroup.py
--- mercurial-1.6.2/mercurial/changegroup.py 2009-01-01 00:38:33.000000000 +0100
+++ mercurial-1.6.2-nobz2/mercurial/changegroup.py 2009-01-01 13:52:05.000000000 +0100
@@ -8,5 +8,5 @@
from i18n import _ from i18n import _
import util import util
-import struct, os, bz2, zlib, tempfile -import struct, os, bz2, zlib, tempfile
+import struct, os, zlib, tempfile +import struct, os, zlib, tempfile
def getchunk(source): def getchunk(source):
@@ -52,7 +52,6 @@ """return the next chunk from changegroup 'source' as a string"""
@@ -41,7 +41,6 @@ class nocompress(object):
bundletypes = { bundletypes = {
"": ("", nocompress), "": ("", nocompress),
"HG10UN": ("HG10UN", nocompress), "HG10UN": ("HG10UN", nocompress),
@ -69,29 +55,38 @@ diff -urN mercurial-1.6.2/mercurial/changegroup.py mercurial-1.6.2-nobz2/mercuri
"HG10GZ": ("HG10GZ", lambda: zlib.compressobj()), "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()),
} }
@@ -69,4 +68,4 @@ @@ -55,14 +54,13 @@ def collector(cl, mmfs, files):
return collect
# hgweb uses this list to communicate its preferred type # hgweb uses this list to communicate its preferred type
-bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN'] -bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN']
+bundlepriority = ['HG10GZ', 'HG10UN'] +bundlepriority = ['HG10GZ', 'HG10UN']
def writebundle(cg, filename, bundletype): def writebundle(cg, filename, bundletype):
@@ -135,12 +134,6 @@ """Write a bundle file and return its filename.
Existing files will not be overwritten.
If no filename is specified, a temporary file is created.
- bz2 compression can be turned off.
The bundle file will be deleted in case of errors.
"""
@@ -120,12 +118,6 @@ def decompressor(fh, alg):
zd = zlib.decompressobj() zd = zlib.decompressobj()
for chunk in f: for chunk in f:
yield zd.decompress(chunk) yield zd.decompress(chunk)
- elif header == 'HG10BZ': - elif alg == 'BZ':
- def generator(f): - def generator(f):
- zd = bz2.BZ2Decompressor() - zd = bz2.BZ2Decompressor()
- zd.decompress("BZ") - zd.decompress("BZ")
- for chunk in util.filechunkiter(f, 4096): - for chunk in util.filechunkiter(f, 4096):
- yield zd.decompress(chunk) - yield zd.decompress(chunk)
else:
raise util.Abort("unknown bundle compression '%s'" % alg)
return util.chunkbuffer(generator(fh)) return util.chunkbuffer(generator(fh))
--- a/mercurial/hgweb/hgwebdir_mod.py
def readbundle(fh, fname): +++ b/mercurial/hgweb/hgwebdir_mod.py
diff -urN mercurial-1.6.2/mercurial/hgweb/hgwebdir_mod.py mercurial-1.6.2-nobz2/mercurial/hgweb/hgwebdir_mod.py @@ -192,7 +192,7 @@ class hgwebdir(object):
--- mercurial-1.6.2/mercurial/hgweb/hgwebdir_mod.py 2009-01-01 00:38:33.000000000 +0100
+++ mercurial-1.6.2-nobz2/mercurial/hgweb/hgwebdir_mod.py 2009-01-01 13:54:29.000000000 +0100
@@ -191,7 +191,7 @@
def archivelist(ui, nodeid, url): def archivelist(ui, nodeid, url):
allowed = ui.configlist("web", "allow_archive", untrusted=True) allowed = ui.configlist("web", "allow_archive", untrusted=True)
@ -100,10 +95,9 @@ diff -urN mercurial-1.6.2/mercurial/hgweb/hgwebdir_mod.py mercurial-1.6.2-nobz2/
if i[0] in allowed or ui.configbool("web", "allow" + i[0], if i[0] in allowed or ui.configbool("web", "allow" + i[0],
untrusted=True): untrusted=True):
yield {"type" : i[0], "extension": i[1], yield {"type" : i[0], "extension": i[1],
diff -urN mercurial-1.6.2/mercurial/hgweb/hgweb_mod.py mercurial-1.6.2-nobz2/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py
--- mercurial-1.6.2/mercurial/hgweb/hgweb_mod.py 2009-01-01 00:38:33.000000000 +0100 +++ b/mercurial/hgweb/hgweb_mod.py
+++ mercurial-1.6.2-nobz2/mercurial/hgweb/hgweb_mod.py 2009-01-01 13:55:08.000000000 +0100 @@ -39,7 +39,7 @@ class hgweb(object):
@@ -38,7 +38,7 @@
hook.redirect(True) hook.redirect(True)
self.mtime = -1 self.mtime = -1
self.reponame = name self.reponame = name
@ -112,35 +106,47 @@ diff -urN mercurial-1.6.2/mercurial/hgweb/hgweb_mod.py mercurial-1.6.2-nobz2/mer
self.stripecount = 1 self.stripecount = 1
# a repo owner may set web.templates in .hg/hgrc to get any file # a repo owner may set web.templates in .hg/hgrc to get any file
# readable by the user running the CGI script # readable by the user running the CGI script
@@ -281,7 +281,6 @@ @@ -280,7 +280,6 @@ class hgweb(object):
yield {"type" : i, "extension" : spec[2], "node" : nodeid} yield {"type" : i, "extension" : spec[2], "node" : nodeid}
archive_specs = { archive_specs = {
- 'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None), - 'bz2': ('application/x-bzip2', 'tbz2', '.tar.bz2', None),
'gz': ('application/x-tar', 'tgz', '.tar.gz', None), 'gz': ('application/x-gzip', 'tgz', '.tar.gz', None),
'zip': ('application/zip', 'zip', '.zip', None), 'zip': ('application/zip', 'zip', '.zip', None),
} }
diff -urN mercurial-1.6.2/mercurial/repair.py mercurial-1.6.2-nobz2/mercurial/repair.py --- a/mercurial/repair.py
--- mercurial-1.6.2/mercurial/repair.py 2009-01-01 00:38:33.000000000 +0100 +++ b/mercurial/repair.py
+++ mercurial-1.6.2-nobz2/mercurial/repair.py 2009-01-01 13:55:08.000000000 +0100 @@ -19,7 +19,7 @@ def _bundle(repo, bases, heads, node, su
@@ -20,4 +20,4 @@ os.mkdir(backupdir)
name = os.path.join(backupdir, "%s-%s.hg" % (short(node), suffix)) name = os.path.join(backupdir, "%s-%s.hg" % (short(node), suffix))
- return changegroup.writebundle(cg, name, "HG10BZ") if compress:
+ return changegroup.writebundle(cg, name, "HG10GZ") - bundletype = "HG10BZ"
+ bundletype = "HG10GZ"
else:
bundletype = "HG10UN"
return changegroup.writebundle(cg, name, bundletype)
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -162,7 +162,6 @@ def archive(ui, repo, dest, **opts):
def _collectfiles(repo, striprev): :``files``: a directory full of files (default)
diff -urN mercurial-1.6.2/mercurial/commands.py mercurial-1.6.2-nobz2/mercurial/commands.py :``tar``: tar archive, uncompressed
--- mercurial-1.6.2/mercurial/commands.py 2009-01-01 00:38:33.000000000 +0100 - :``tbz2``: tar archive, compressed using bzip2
+++ mercurial-1.6.2-nobz2/mercurial/commands.py 2009-01-01 13:55:08.000000000 +0100 :``tgz``: tar archive, compressed using gzip
@@ -200,7 +200,6 @@ :``uzip``: zip archive, uncompressed
def guess_type(): :``zip``: zip archive, compressed using deflate
exttypes = { @@ -559,8 +558,8 @@ def bundle(ui, repo, fname, dest=None, *
'tar': ['.tar'], -a/--all (or --base null).
- 'tbz2': ['.tbz2', '.tar.bz2'],
'tgz': ['.tgz', '.tar.gz'], You can change compression method with the -t/--type option.
'zip': ['.zip'], - The available compression methods are: none, bzip2, and
} - gzip (by default, bundles are compressed using bzip2).
@@ -613,8 +612,8 @@ + The available compression methods are: none, and
+ gzip (by default, bundles are compressed using gzip).
The bundle file can then be transferred using conventional means
and applied to another repository with the unbundle or pull
@@ -624,8 +623,8 @@ def bundle(ui, repo, fname, dest=None, *
else: else:
cg = repo.changegroup(o, 'bundle') cg = repo.changegroup(o, 'bundle')
@ -151,16 +157,7 @@ diff -urN mercurial-1.6.2/mercurial/commands.py mercurial-1.6.2-nobz2/mercurial/
bundletype = btypes.get(bundletype) bundletype = btypes.get(bundletype)
if bundletype not in changegroup.bundletypes: if bundletype not in changegroup.bundletypes:
raise util.Abort(_('unknown bundle type specified with --type')) raise util.Abort(_('unknown bundle type specified with --type'))
@@ -2365,7 +2364,7 @@ @@ -4084,7 +4083,7 @@ table = {
cg = other.changegroup(incoming, "incoming")
else:
cg = other.changegroupsubset(incoming, revs, 'incoming')
- bundletype = other.local() and "HG10BZ" or "HG10UN"
+ bundletype = other.local() and "HG10GZ" or "HG10UN"
fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
# keep written bundle?
if opts["bundle"]:
@@ -4043,7 +4042,7 @@
_('a base changeset assumed to be available at the destination'), _('a base changeset assumed to be available at the destination'),
_('REV')), _('REV')),
('a', 'all', None, _('bundle all changesets in the repository')), ('a', 'all', None, _('bundle all changesets in the repository')),
@ -169,16 +166,18 @@ diff -urN mercurial-1.6.2/mercurial/commands.py mercurial-1.6.2-nobz2/mercurial/
_('bundle compression type to use'), _('TYPE')), _('bundle compression type to use'), _('TYPE')),
] + remoteopts, ] + remoteopts,
_('[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]')), _('[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]')),
diff -urN mercurial-1.6.2/setup.py mercurial-1.6.2-nobz2/setup.py --- a/setup.py
--- mercurial-1.6.2/setup.py 2009-01-01 00:38:33.000000000 +0100 +++ b/setup.py
+++ mercurial-1.6.2-nobz2/setup.py 2009-01-01 13:55:08.000000000 +0100 @@ -36,12 +36,6 @@ except:
@@ -27,9 +27,3 @@ raise SystemExit(
"Couldn't import standard zlib (incomplete Python install).") "Couldn't import standard zlib (incomplete Python install).")
-
-try: -try:
- import bz2 - import bz2
-except: -except:
- raise SystemExit( - raise SystemExit(
- "Couldn't import standard bz2 (incomplete Python install).") - "Couldn't import standard bz2 (incomplete Python install).")
-
import os, subprocess, time import os, subprocess, time
import shutil
import tempfile