[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

request for a freeze exception for mercurial



  Hi,

  mercurial 1.0.1-3 (currently in lenny) is incompatible with
python-subversion >= 1.5 (it works with python-subversion 1.4 that
is not in lenny anymore). This bug does not touch the core mercurial
operations but it prevents any conversion from subversion repository
to mercurial.
  Upstream made a patch I added in mercurial 1.0.1-4 (currently in
sid). This bug was discovered near the freeze time (but I was in
vacation) and fully fixed upstream only yesterday.

  I would be very pleased if you accept to add a freeze exception
for mercurial so that it can migrate after 10 days in sid.

  Note: in mercurial 1.0.1-4, I also fix a bashism in postinst.
The interdiff between -3 and -4 is attached to this mail (there is
a changelog entry, the fix for bashism and the patch for #492244 in the
quilt series)

  Best regards,
   Vincent

--
Vincent Danjean       GPG key ID 0x9D025E87         vdanjean@debian.org
GPG key fingerprint: FC95 08A6 854D DB48 4B9A  8A94 0BF7 7867 9D02 5E87
Unofficial pacakges: http://www-id.imag.fr/~danjean/deb.html#package
APT repo:  deb http://perso.debian.org/~vdanjean/debian unstable main

diff -u mercurial-1.0.1/debian/changelog mercurial-1.0.1/debian/changelog
--- mercurial-1.0.1/debian/changelog
+++ mercurial-1.0.1/debian/changelog
@@ -1,3 +1,11 @@
+mercurial (1.0.1-4) unstable; urgency=low
+
+  * fix subversion 1.5 compatibility (Closes: #492244)
+    using upstream patch
+  * fix bashism in postinst
+
+ -- Vincent Danjean <vdanjean@debian.org>  Thu, 31 Jul 2008 14:27:51 +0200
+
 mercurial (1.0.1-3) unstable; urgency=low
 
   * debian/control:
diff -u mercurial-1.0.1/debian/mercurial.postinst mercurial-1.0.1/debian/mercurial.postinst
--- mercurial-1.0.1/debian/mercurial.postinst
+++ mercurial-1.0.1/debian/mercurial.postinst
@@ -18,10 +18,14 @@
 # the debian-policy package
 
 check_ext() {
-    local file="$1"
-    local ext="$2"
-    local dep="$3"
-    local enable="true"
+    local file
+    local ext
+    local dep
+    local enable
+    file="$1"
+    ext="$2"
+    dep="$3"
+    enable="true"
 
     case "$dep" in
     wish)
diff -u mercurial-1.0.1/debian/patches/series mercurial-1.0.1/debian/patches/series
--- mercurial-1.0.1/debian/patches/series
+++ mercurial-1.0.1/debian/patches/series
@@ -9,0 +10 @@
+backport__svn1.5-fix.patch
only in patch2:
unchanged:
--- mercurial-1.0.1.orig/debian/patches/backport__svn1.5-fix.patch
+++ mercurial-1.0.1/debian/patches/backport__svn1.5-fix.patch
@@ -0,0 +1,227 @@
+diff -r e37fa751182a -r 6ec941b6003d hgext/convert/subversion.py
+--- a/hgext/convert/subversion.py	Fri Jul 25 13:26:16 2008 +0200
++++ b/hgext/convert/subversion.py	Wed Jul 30 22:26:41 2008 +0200
+@@ -130,18 +130,6 @@
+             self._stdout.close()
+             self._stdout = None
+ 
+-def get_log(url, paths, start, end, limit=0, discover_changed_paths=True,
+-                strict_node_history=False):
+-    args = [url, paths, start, end, limit, discover_changed_paths,
+-            strict_node_history]
+-    arg = encodeargs(args)
+-    hgexe = util.hgexecutable()
+-    cmd = '%s debugsvnlog' % util.shellquote(hgexe)
+-    stdin, stdout = os.popen2(cmd, 'b')
+-    stdin.write(arg)
+-    stdin.close()
+-    return logstream(stdout)
+-
+ # SVN conversion code stolen from bzr-svn and tailor
+ #
+ # Subversion looks like a versioned filesystem, branches structures
+@@ -188,6 +176,7 @@
+             # Module is either empty or a repository path starting with
+             # a slash and not ending with a slash.
+             self.module = self.url[len(self.base):]
++            self.prevmodule = None
+             self.rootmodule = self.module
+             self.commits = {}
+             self.paths = {}
+@@ -250,7 +239,7 @@
+     def getheads(self):
+ 
+         def isdir(path, revnum):
+-            kind = svn.ra.check_path(self.ra, path, revnum)
++            kind = self._checkpath(path, revnum)
+             return kind == svn.core.svn_node_dir
+ 
+         def getcfgpath(name, rev):
+@@ -393,7 +382,7 @@
+         tagspath = self.tags
+         start = svn.ra.get_latest_revnum(self.ra)
+         try:
+-            for entry in get_log(self.url, [self.tags], start, self.startrev):
++            for entry in self._getlog([self.tags], start, self.startrev):
+                 origpaths, revnum, author, date, message = entry
+                 copies = [(e.copyfrom_path, e.copyfrom_rev, p) for p, e
+                           in origpaths.iteritems() if e.copyfrom_path]
+@@ -478,9 +467,9 @@
+         if not stop:
+             stop = svn.ra.get_latest_revnum(self.ra)
+         try:
+-            self.reparent('')
++            prevmodule = self.reparent('')
+             dirent = svn.ra.stat(self.ra, path.strip('/'), stop)
+-            self.reparent(self.module)
++            self.reparent(prevmodule)
+         except SubversionException:
+             dirent = None
+         if not dirent:
+@@ -489,7 +478,7 @@
+         # stat() gives us the previous revision on this line of development, but
+         # it might be in *another module*. Fetch the log and detect renames down
+         # to the latest revision.
+-        stream = get_log(self.url, [path], stop, dirent.created_rev)
++        stream = self._getlog([path], stop, dirent.created_rev)
+         try:
+             for entry in stream:
+                 paths, revnum, author, date, message = entry
+@@ -532,9 +521,17 @@
+         return svn_rev in self.blacklist
+ 
+     def reparent(self, module):
+-        svn_url = self.base + module
+-        self.ui.debug("reparent to %s\n" % svn_url.encode(self.encoding))
+-        svn.ra.reparent(self.ra, svn_url.encode(self.encoding))
++        """Reparent the svn transport and return the previous parent."""
++        if self.prevmodule == module:
++            return module
++        svn_url = (self.base + module).encode(self.encoding)
++        prevmodule = self.prevmodule
++        if prevmodule is None:
++            prevmodule = ''
++        self.ui.debug("reparent to %s\n" % svn_url)
++        svn.ra.reparent(self.ra, svn_url)
++        self.prevmodule = module
++        return prevmodule
+ 
+     def expandpaths(self, rev, paths, parents):
+         entries = []
+@@ -550,7 +547,7 @@
+             entrypath = self.getrelpath(path)
+             entry = entrypath.decode(self.encoding)
+ 
+-            kind = svn.ra.check_path(self.ra, entrypath, revnum)
++            kind = self._checkpath(entrypath, revnum)
+             if kind == svn.core.svn_node_file:
+                 entries.append(self.recode(entry))
+                 if not ent.copyfrom_path or not parents:
+@@ -604,9 +601,9 @@
+ 
+                 # We can avoid the reparent calls if the module has not changed
+                 # but it probably does not worth the pain.
+-                self.reparent('')
++                prevmodule = self.reparent('')
+                 fromkind = svn.ra.check_path(self.ra, entrypath.strip('/'), fromrev)
+-                self.reparent(self.module)
++                self.reparent(prevmodule)
+ 
+                 if fromkind == svn.core.svn_node_file:   # a deleted file
+                     entries.append(self.recode(entry))
+@@ -669,7 +666,7 @@
+                     # print child, self.module, entrypath
+                     if entrypath:
+                         # Need to filter out directories here...
+-                        kind = svn.ra.check_path(self.ra, entrypath, revnum)
++                        kind = self._checkpath(entrypath, revnum)
+                         if kind != svn.core.svn_node_dir:
+                             entries.append(self.recode(entrypath))
+ 
+@@ -805,7 +802,7 @@
+         try:
+             firstcset = None
+             lastonbranch = False
+-            stream = get_log(self.url, [self.module], from_revnum, to_revnum)
++            stream = self._getlog([self.module], from_revnum, to_revnum)
+             try:
+                 for entry in stream:
+                     paths, revnum, author, date, message = entry
+@@ -897,6 +894,30 @@
+         # The path is outside our tracked tree...
+         self.ui.debug('%r is not under %r, ignoring\n' % (path, module))
+         return None
++
++    def _checkpath(self, path, revnum):
++        # ra.check_path does not like leading slashes very much, it leads
++        # to PROPFIND subversion errors
++        return svn.ra.check_path(self.ra, path.strip('/'), revnum)
++
++    def _getlog(self, paths, start, end, limit=0, discover_changed_paths=True,
++                strict_node_history=False):
++        # Normalize path names, svn >= 1.5 only wants paths relative to
++        # supplied URL
++        relpaths = []
++        for p in paths:
++            if not p.startswith('/'):
++                p = self.module + '/' + p
++            relpaths.append(p.strip('/'))
++        args = [self.base, relpaths, start, end, limit, discover_changed_paths,
++                strict_node_history]
++        arg = encodeargs(args)
++        hgexe = util.hgexecutable()
++        cmd = '%s debugsvnlog' % util.shellquote(hgexe)
++        stdin, stdout = os.popen2(cmd, 'b')
++        stdin.write(arg)
++        stdin.close()
++        return logstream(stdout)
+ 
+ pre_revprop_change = '''#!/bin/sh
+ 
+diff -r e37fa751182a -r 6ec941b6003d tests/test-convert-svn-branches
+--- a/tests/test-convert-svn-branches	Fri Jul 25 13:26:16 2008 +0200
++++ b/tests/test-convert-svn-branches	Wed Jul 30 22:26:41 2008 +0200
+@@ -58,7 +58,7 @@
+ svn ci -m "change b"
+ 
+ echo % create a cross-branch revision
+-svn move -m "move b" trunk/b branches/old/c
++svn move trunk/b branches/old/c
+ "$TESTDIR/svn-safe-append.py" c branches/old/c
+ svn ci -m "move and update c"
+ 
+diff -r e37fa751182a -r 6ec941b6003d tests/test-convert-svn-move
+--- a/tests/test-convert-svn-move	Fri Jul 25 13:26:16 2008 +0200
++++ b/tests/test-convert-svn-move	Wed Jul 30 22:26:41 2008 +0200
+@@ -58,10 +58,19 @@
+ svn rm subproject/trunk/d2
+ svn ci -m "changeb and rm d2"
+ svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
+-echo % copy a file from a past revision
+-svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast
+-echo % copy a directory from a past revision
+-svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
++
++if svn help copy | grep 'SRC\[@REV\]' > /dev/null 2>&1; then
++    # SVN >= 1.5 replaced the -r REV syntax with @REV
++    echo % copy a file from a past revision
++    svn copy $svnurl/subproject/trunk/d2/d@7 $svnurl/subproject/trunk -m copyfilefrompast
++    echo % copy a directory from a past revision
++    svn copy $svnurl/subproject/trunk/d2@7 $svnurl/subproject/trunk -m copydirfrompast
++else
++    echo % copy a file from a past revision
++    svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast
++    echo % copy a directory from a past revision
++    svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
++fi
+ cd ..
+ 
+ echo % convert trunk and branches
+diff -r e37fa751182a -r 6ec941b6003d tests/test-convert-svn-tags
+--- a/tests/test-convert-svn-tags	Fri Jul 25 13:26:16 2008 +0200
++++ b/tests/test-convert-svn-tags	Wed Jul 30 22:26:41 2008 +0200
+@@ -31,7 +31,7 @@
+ cd ..
+ 
+ svnurl=file://$svnpath/svn-repo/projA
+-svn import -m "init projA" projA $svnurl | fix_path
++svn import -m "init projA" projA $svnurl | fix_path | sort
+ 
+ echo % update svn repository
+ svn co $svnurl A | fix_path
+diff -r e37fa751182a -r 6ec941b6003d tests/test-convert-svn-tags.out
+--- a/tests/test-convert-svn-tags.out	Fri Jul 25 13:26:16 2008 +0200
++++ b/tests/test-convert-svn-tags.out	Wed Jul 30 22:26:41 2008 +0200
+@@ -1,9 +1,9 @@
+ % initial svn import
++
++Adding         projA/branches
++Adding         projA/tags
+ Adding         projA/trunk
+ Adding         projA/unrelated
+-Adding         projA/branches
+-Adding         projA/tags
+-
+ Committed revision 1.
+ % update svn repository
+ A    A/trunk

Reply to: