Update mercurial to 1.1.2 (#4407)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@13823 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2009-01-02 14:59:14 +00:00
parent 822a7a1f72
commit c1359fe6e2
2 changed files with 126 additions and 210 deletions

View File

@ -9,12 +9,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=mercurial PKG_NAME:=mercurial
PKG_VERSION:=1.0.2 PKG_VERSION:=1.1.2
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE_URL:=http://selenic.com/mercurial/release/ PKG_SOURCE_URL:=http://selenic.com/mercurial/release/
PKG_SOURCE:=mercurial-$(PKG_VERSION).tar.gz PKG_SOURCE:=mercurial-$(PKG_VERSION).tar.gz
PKG_MD5SUM:=32432616f517107e6582721c257cd1f4 PKG_MD5SUM:=4fd3b9a2e5dcd025840c3849b136bec8
PKG_BUILD_DEPENDS:=python PKG_BUILD_DEPENDS:=python
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@ -1,208 +1,124 @@
diff -rc mercurial-1.0.orig/mercurial/archival.py mercurial-1.0/mercurial/archival.py diff -urN mercurial-1.1.2/mercurial/archival.py mercurial-1.1.2-nobz2/mercurial/archival.py
*** mercurial-1.0.orig/mercurial/archival.py 2008-03-25 00:05:20.000000000 +0100 --- mercurial-1.1.2/mercurial/archival.py 2009-01-01 00:38:33.000000000 +0100
--- mercurial-1.0/mercurial/archival.py 2008-04-13 02:22:47.000000000 +0200 +++ mercurial-1.1.2-nobz2/mercurial/archival.py 2009-01-01 13:53:14.000000000 +0100
*************** @@ -65,8 +65,8 @@
*** 64,71 **** self.fileobj.write(fname + '\000')
self.fileobj.write(fname + '\000')
def __init__(self, dest, prefix, mtime, kind=''):
def __init__(self, dest, prefix, mtime, kind=''): - self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.bz2', '.tar.gz',
! self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.bz2', '.tar.gz', - '.tgz', '.tbz2'])
! '.tgz', '.tbz2']) + self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.gz',
self.mtime = mtime + '.tgz'])
self.mtime = mtime
def taropen(name, mode, fileobj=None):
--- 64,71 ---- def taropen(name, mode, fileobj=None):
self.fileobj.write(fname + '\000') @@ -179,7 +179,6 @@
archivers = {
def __init__(self, dest, prefix, mtime, kind=''): 'files': fileit,
! self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.gz', 'tar': tarit,
! '.tgz']) - 'tbz2': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'bz2'),
self.mtime = mtime 'tgz': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'gz'),
'uzip': lambda name, prefix, mtime: zipit(name, prefix, mtime, False),
def taropen(name, mode, fileobj=None): 'zip': zipit,
*************** diff -urN mercurial-1.1.2/mercurial/bundlerepo.py mercurial-1.1.2-nobz2/mercurial/bundlerepo.py
*** 178,184 **** --- mercurial-1.1.2/mercurial/bundlerepo.py 2009-01-01 00:38:33.000000000 +0100
archivers = { +++ mercurial-1.1.2-nobz2/mercurial/bundlerepo.py 2009-01-01 13:53:59.000000000 +0100
'files': fileit, @@ -12,7 +12,7 @@
'tar': tarit,
- 'tbz2': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'bz2'), from node import hex, nullid, short
'tgz': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'gz'), from i18n import _
'uzip': lambda name, prefix, mtime: zipit(name, prefix, mtime, False), -import changegroup, util, os, struct, bz2, zlib, tempfile, shutil, mdiff
'zip': zipit, +import changegroup, util, os, struct, zlib, tempfile, shutil, mdiff
--- 178,183 ---- import repo, localrepo, changelog, manifest, filelog, revlog, context
diff -rc mercurial-1.0.orig/mercurial/bundlerepo.py mercurial-1.0/mercurial/bundlerepo.py
*** mercurial-1.0.orig/mercurial/bundlerepo.py 2008-03-25 00:05:20.000000000 +0100 class bundlerevlog(revlog.revlog):
--- mercurial-1.0/mercurial/bundlerepo.py 2008-04-13 02:23:54.000000000 +0200 @@ -173,16 +173,13 @@
*************** raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename)
*** 12,18 **** elif not header.startswith("HG10"):
raise util.Abort(_("%s: unknown bundle version") % bundlename)
from node import hex, nullid, short - elif (header == "HG10BZ") or (header == "HG10GZ"):
from i18n import _ + elif (header == "HG10GZ"):
! import changegroup, util, os, struct, bz2, tempfile, shutil, mdiff fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-",
import repo, localrepo, changelog, manifest, filelog, revlog suffix=".hg10un", dir=self.path)
self.tempfile = temp
class bundlerevlog(revlog.revlog): fptemp = os.fdopen(fdtemp, 'wb')
--- 12,18 ---- def generator(f):
- if header == "HG10BZ":
from node import hex, nullid, short - zd = bz2.BZ2Decompressor()
from i18n import _ - zd.decompress("BZ")
! import changegroup, util, os, struct, tempfile, shutil, mdiff - elif header == "HG10GZ":
import repo, localrepo, changelog, manifest, filelog, revlog + if header == "HG10GZ":
zd = zlib.decompressobj()
class bundlerevlog(revlog.revlog): for chunk in f:
*************** yield zd.decompress(chunk)
*** 173,201 **** diff -urN mercurial-1.1.2/mercurial/changegroup.py mercurial-1.1.2-nobz2/mercurial/changegroup.py
raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename) --- mercurial-1.1.2/mercurial/changegroup.py 2009-01-01 00:38:33.000000000 +0100
elif not header.startswith("HG10"): +++ mercurial-1.1.2-nobz2/mercurial/changegroup.py 2009-01-01 13:52:05.000000000 +0100
raise util.Abort(_("%s: unknown bundle version") % bundlename) @@ -8,7 +8,7 @@
- elif header == "HG10BZ": """
- fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-",
- suffix=".hg10un", dir=self.path) from i18n import _
- self.tempfile = temp -import struct, os, bz2, zlib, util, tempfile
- fptemp = os.fdopen(fdtemp, 'wb') +import struct, os, zlib, util, tempfile
- def generator(f):
- zd = bz2.BZ2Decompressor() def getchunk(source):
- zd.decompress("BZ") """get a chunk from a changegroup"""
- for chunk in f: @@ -49,12 +49,11 @@
- yield zd.decompress(chunk) bundletypes = {
- gen = generator(util.filechunkiter(self.bundlefile, 4096)) "": ("", nocompress),
- "HG10UN": ("HG10UN", nocompress),
- try: - "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()),
- fptemp.write("HG10UN") "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()),
- for chunk in gen: }
- fptemp.write(chunk)
- finally: # hgweb uses this list to communicate it's preferred type
- fptemp.close() -bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN']
- self.bundlefile.close() +bundlepriority = ['HG10GZ', 'HG10UN']
-
- self.bundlefile = open(self.tempfile, "rb") def writebundle(cg, filename, bundletype):
- # seek right after the header """Write a bundle file and return its filename.
- self.bundlefile.seek(6) @@ -122,12 +121,6 @@
elif header == "HG10UN": zd = zlib.decompressobj()
# nothing to do for chunk in f:
pass yield zd.decompress(chunk)
--- 173,178 ---- - elif header == 'HG10BZ':
diff -rc mercurial-1.0.orig/mercurial/changegroup.py mercurial-1.0/mercurial/changegroup.py - def generator(f):
*** mercurial-1.0.orig/mercurial/changegroup.py 2008-03-25 00:05:20.000000000 +0100 - zd = bz2.BZ2Decompressor()
--- mercurial-1.0/mercurial/changegroup.py 2008-04-13 02:24:40.000000000 +0200 - zd.decompress("BZ")
*************** - for chunk in util.filechunkiter(f, 4096):
*** 8,14 **** - yield zd.decompress(chunk)
""" return util.chunkbuffer(generator(fh))
from i18n import _ def readbundle(fh, fname):
! import struct, os, bz2, zlib, util, tempfile diff -urN mercurial-1.1.2/mercurial/hgweb/hgwebdir_mod.py mercurial-1.1.2-nobz2/mercurial/hgweb/hgwebdir_mod.py
--- mercurial-1.1.2/mercurial/hgweb/hgwebdir_mod.py 2009-01-01 00:38:33.000000000 +0100
def getchunk(source): +++ mercurial-1.1.2-nobz2/mercurial/hgweb/hgwebdir_mod.py 2009-01-01 13:54:29.000000000 +0100
"""get a chunk from a changegroup""" @@ -178,7 +178,7 @@
--- 8,14 ----
""" def archivelist(ui, nodeid, url):
allowed = ui.configlist("web", "allow_archive", untrusted=True)
from i18n import _ - for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
! import struct, os, zlib, util, tempfile + for i in [('zip', '.zip'), ('gz', '.tar.gz')]:
if i[0] in allowed or ui.configbool("web", "allow" + i[0],
def getchunk(source): untrusted=True):
"""get a chunk from a changegroup""" yield {"type" : i[0], "extension": i[1],
*************** diff -urN mercurial-1.1.2/mercurial/hgweb/hgweb_mod.py mercurial-1.1.2-nobz2/mercurial/hgweb/hgweb_mod.py
*** 49,60 **** --- mercurial-1.1.2/mercurial/hgweb/hgweb_mod.py 2009-01-01 00:38:33.000000000 +0100
bundletypes = { +++ mercurial-1.1.2-nobz2/mercurial/hgweb/hgweb_mod.py 2009-01-01 13:55:08.000000000 +0100
"": ("", nocompress), @@ -35,7 +35,7 @@
"HG10UN": ("HG10UN", nocompress), hook.redirect(True)
- "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()), self.mtime = -1
"HG10GZ": ("HG10GZ", lambda: zlib.compressobj()), self.reponame = name
} - self.archives = 'zip', 'gz', 'bz2'
+ self.archives = 'zip', 'gz'
# hgweb uses this list to communicate it's preferred type self.stripecount = 1
! bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN'] # a repo owner may set web.templates in .hg/hgrc to get any file
# readable by the user running the CGI script
def writebundle(cg, filename, bundletype): @@ -266,7 +266,6 @@
"""Write a bundle file and return its filename. yield {"type" : i, "extension" : spec[2], "node" : nodeid}
--- 49,59 ----
bundletypes = { archive_specs = {
"": ("", nocompress), - 'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None),
"HG10UN": ("HG10UN", nocompress), 'gz': ('application/x-tar', 'tgz', '.tar.gz', None),
"HG10GZ": ("HG10GZ", lambda: zlib.compressobj()), 'zip': ('application/zip', 'zip', '.zip', None),
} }
# hgweb uses this list to communicate it's preferred type
! bundlepriority = ['HG10GZ', 'HG10UN']
def writebundle(cg, filename, bundletype):
"""Write a bundle file and return its filename.
***************
*** 122,133 ****
zd = zlib.decompressobj()
for chunk in f:
yield zd.decompress(chunk)
- elif header == 'HG10BZ':
- def generator(f):
- zd = bz2.BZ2Decompressor()
- zd.decompress("BZ")
- for chunk in util.filechunkiter(f, 4096):
- yield zd.decompress(chunk)
return util.chunkbuffer(generator(fh))
def readbundle(fh, fname):
--- 121,126 ----
diff -rc mercurial-1.0.orig/mercurial/commands.py mercurial-1.0/mercurial/commands.py
*** mercurial-1.0.orig/mercurial/commands.py 2008-03-25 00:05:20.000000000 +0100
--- mercurial-1.0/mercurial/commands.py 2008-04-13 02:24:54.000000000 +0200
***************
*** 139,145 ****
"files" (default): a directory full of files
"tar": tar archive, uncompressed
- "tbz2": tar archive, compressed using bzip2
"tgz": tar archive, compressed using gzip
"uzip": zip archive, uncompressed
"zip": zip archive, compressed using deflate
--- 139,144 ----
diff -rc mercurial-1.0.orig/mercurial/hgweb/hgwebdir_mod.py mercurial-1.0/mercurial/hgweb/hgwebdir_mod.py
*** mercurial-1.0.orig/mercurial/hgweb/hgwebdir_mod.py 2008-03-25 00:05:20.000000000 +0100
--- mercurial-1.0/mercurial/hgweb/hgwebdir_mod.py 2008-04-13 02:25:33.000000000 +0200
***************
*** 152,158 ****
def archivelist(ui, nodeid, url):
allowed = ui.configlist("web", "allow_archive", untrusted=True)
! for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
if i[0] in allowed or ui.configbool("web", "allow" + i[0],
untrusted=True):
yield {"type" : i[0], "extension": i[1],
--- 152,158 ----
def archivelist(ui, nodeid, url):
allowed = ui.configlist("web", "allow_archive", untrusted=True)
! for i in [('zip', '.zip'), ('gz', '.tar.gz')]:
if i[0] in allowed or ui.configbool("web", "allow" + i[0],
untrusted=True):
yield {"type" : i[0], "extension": i[1],
diff -rc mercurial-1.0.orig/mercurial/hgweb/hgweb_mod.py mercurial-1.0/mercurial/hgweb/hgweb_mod.py
*** mercurial-1.0.orig/mercurial/hgweb/hgweb_mod.py 2008-03-25 00:05:20.000000000 +0100
--- mercurial-1.0/mercurial/hgweb/hgweb_mod.py 2008-04-13 02:25:49.000000000 +0200
***************
*** 91,97 ****
hook.redirect(True)
self.mtime = -1
self.reponame = name
! self.archives = 'zip', 'gz', 'bz2'
self.stripecount = 1
self._capabilities = None
# a repo owner may set web.templates in .hg/hgrc to get any file
--- 91,97 ----
hook.redirect(True)
self.mtime = -1
self.reponame = name
! self.archives = 'zip', 'gz'
self.stripecount = 1
self._capabilities = None
# a repo owner may set web.templates in .hg/hgrc to get any file
***************
*** 915,921 ****
diff=diff)
archive_specs = {
- 'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None),
'gz': ('application/x-tar', 'tgz', '.tar.gz', None),
'zip': ('application/zip', 'zip', '.zip', None),
}
--- 915,920 ----