changeset 3902:0d27502a804c

Merge with crew-stable
author Brendan Cully <brendan@kublai.com>
date Fri, 15 Dec 2006 18:38:09 -0800
parents 316cd5b0c940 (current diff) 733d56b8830f (diff)
children f9136599700f
files hgext/mq.py mercurial/commands.py mercurial/patch.py
diffstat 5 files changed, 80 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Fri Dec 15 11:14:55 2006 -0800
+++ b/hgext/mq.py	Fri Dec 15 18:38:09 2006 -0800
@@ -700,6 +700,7 @@
         if saveheads:
             backupch = repo.changegroupsubset(savebases.keys(), saveheads, 'strip')
             chgrpfile = bundle(backupch)
+            chgrpfile = 'file:%s' % chgrpfile
 
         stripall(rev, revnum)
 
--- a/mercurial/commands.py	Fri Dec 15 11:14:55 2006 -0800
+++ b/mercurial/commands.py	Fri Dec 15 18:38:09 2006 -0800
@@ -1065,7 +1065,7 @@
         ui.note(_('exporting patches:\n'))
     else:
         ui.note(_('exporting patch:\n'))
-    patch.export(repo, map(repo.lookup, revs), template=opts['output'],
+    patch.export(repo, revs, template=opts['output'],
                  switch_parent=opts['switch_parent'],
                  opts=patch.diffopts(ui, opts))
 
--- a/mercurial/patch.py	Fri Dec 15 11:14:55 2006 -0800
+++ b/mercurial/patch.py	Fri Dec 15 18:38:09 2006 -0800
@@ -625,7 +625,7 @@
     '''export changesets as hg patches.'''
 
     total = len(revs)
-    revwidth = max(map(len, revs))
+    revwidth = max([len(str(rev)) for rev in revs])
 
     def single(node, seqno, fp):
         parents = [p for p in repo.changelog.parents(node) if p != nullid]
@@ -654,8 +654,8 @@
         if fp not in (sys.stdout, repo.ui):
             fp.close()
 
-    for seqno, cset in enumerate(revs):
-        single(cset, seqno, fp)
+    for seqno, rev in enumerate(revs):
+        single(repo.lookup(rev), seqno+1, fp)
 
 def diffstat(patchlines):
     fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-export	Fri Dec 15 18:38:09 2006 -0800
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+hg init repo
+cd repo
+touch foo
+hg add foo
+for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
+    echo "foo-$i" >> foo
+    hg ci -m "foo-$i" -d "0 0"
+done
+
+for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r"; do
+    echo "# foo-$out.patch"
+    hg export -v -o "foo-$out.patch" 2:tip
+done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-export.out	Fri Dec 15 18:38:09 2006 -0800
@@ -0,0 +1,60 @@
+# foo-%nof%N.patch
+exporting patches:
+foo-01of10.patch
+foo-02of10.patch
+foo-03of10.patch
+foo-04of10.patch
+foo-05of10.patch
+foo-06of10.patch
+foo-07of10.patch
+foo-08of10.patch
+foo-09of10.patch
+foo-10of10.patch
+# foo-%%%H.patch
+exporting patches:
+foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch
+foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch
+foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch
+foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch
+foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch
+foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch
+foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch
+foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch
+foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch
+foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch
+# foo-%b-%R.patch
+exporting patches:
+foo-repo-2.patch
+foo-repo-3.patch
+foo-repo-4.patch
+foo-repo-5.patch
+foo-repo-6.patch
+foo-repo-7.patch
+foo-repo-8.patch
+foo-repo-9.patch
+foo-repo-10.patch
+foo-repo-11.patch
+# foo-%h.patch
+exporting patches:
+foo-617188a1c80f.patch
+foo-dd41a5ff707a.patch
+foo-f95a5410f866.patch
+foo-4346bcfde53b.patch
+foo-afda8c3a009c.patch
+foo-35284ce2b6b9.patch
+foo-9688c41894e6.patch
+foo-747d3c68f8ec.patch
+foo-5f17a83f5fbd.patch
+foo-f3acbafac161.patch
+# foo-%r.patch
+exporting patches:
+foo-02.patch
+foo-03.patch
+foo-04.patch
+foo-05.patch
+foo-06.patch
+foo-07.patch
+foo-08.patch
+foo-09.patch
+foo-10.patch
+foo-11.patch