[PATCH STABLE] mq: strip extra whitespace from node ids in header (issue2790)

Kevin Bullock kbullock+mercurial at ringworld.org
Tue May 3 11:46:58 CDT 2011


# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1304441162 18000
# Branch stable
# Node ID 31ec4d7eb63f568654a3f0c9d19c18a23145a12e
# Parent  30cb7ece4378a874c0abc8610ebe5af32d3eb0b7
mq: strip extra whitespace from node ids in header (issue2790)

This makes `hg qpush --exact` work with patches created by `hg export`.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -107,7 +107,7 @@
                 elif line.startswith("# Date "):
                     date = line[7:]
                 elif line.startswith("# Parent "):
-                    parent = line[9:]
+                    parent = line[9:].lstrip()
                 elif line.startswith("# Branch "):
                     branch = line[9:]
                 elif line.startswith("# Node ID "):
diff --git a/tests/test-mq-qpush-exact.t b/tests/test-mq-qpush-exact.t
--- a/tests/test-mq-qpush-exact.t
+++ b/tests/test-mq-qpush-exact.t
@@ -26,7 +26,14 @@
 
   $ echo cp0 >> fp0
   $ hg add fp0
-  $ hg qnew p0 -d "0 0"
+  $ hg ci -m p0 -d "0 0"
+  $ hg export -r. > p0
+  $ hg strip -qn .
+  $ hg qimport p0
+  adding p0 to series file
+  $ hg qpush
+  applying p0
+  now at: p0
 
   $ echo cp1 >> fp1
   $ hg add fp1
@@ -63,15 +70,6 @@
   $ hg qpop -aq
   patch queue now empty
 
-  $ hg qpush -ea
-  applying p0
-  applying p1
-  now at: p1
-  $ hg parents -qr qbase
-  1:d7fe2034f71b
-  $ hg qpop -aq
-  patch queue now empty
-
 qpush --exact when at another rev
 
   $ hg update 0 -q


More information about the Mercurial-devel mailing list