shelve: use colon instead of quotes in 'changes to' description
authorSiddharth Agarwal <sid0@fb.com>
Sun, 22 Nov 2015 21:40:23 -0800
changeset 27092 156985f2dec0
parent 27091 2ce00de5cc0e
child 27093 41d3e307a7c1
shelve: use colon instead of quotes in 'changes to' description If detailed conflict markers are enabled and the closing quote gets truncated, editors will often screw syntax highlighting up from that point because they'll see an opening quote and think it's the beginning of a string. In tests, the hashes change because the commit messages of the shelved bundles also change.
hgext/shelve.py
tests/test-keyword.t
tests/test-shelve.t
--- a/hgext/shelve.py	Sun Nov 22 21:58:28 2015 -0800
+++ b/hgext/shelve.py	Sun Nov 22 21:40:23 2015 -0800
@@ -276,7 +276,7 @@
                 repo.mq.checkapplied = saved
 
     if parent.node() != nullid:
-        desc = "changes to '%s'" % parent.description().split('\n', 1)[0]
+        desc = "changes to: %s" % parent.description().split('\n', 1)[0]
     else:
         desc = '(changes in empty repository)'
 
--- a/tests/test-keyword.t	Sun Nov 22 21:58:28 2015 -0800
+++ b/tests/test-keyword.t	Sun Nov 22 21:40:23 2015 -0800
@@ -1204,7 +1204,7 @@
   +xxxx
   $ hg shelve -q --name tmp
   $ hg shelve --list --patch
-  tmp             (*)    changes to 'localresolve' (glob)
+  tmp             (*)* changes to: localresolve (glob)
   
   diff --git a/a b/a
   --- a/a
--- a/tests/test-shelve.t	Sun Nov 22 21:58:28 2015 -0800
+++ b/tests/test-shelve.t	Sun Nov 22 21:40:23 2015 -0800
@@ -140,11 +140,11 @@
 ensure that our shelved changes exist
 
   $ hg shelve -l
-  default-01      (*)* changes to '[mq]: second.patch' (glob)
-  default         (*)* changes to '[mq]: second.patch' (glob)
+  default-01      (*)* changes to: [mq]: second.patch (glob)
+  default         (*)* changes to: [mq]: second.patch (glob)
 
   $ hg shelve -l -p default
-  default         (*)* changes to '[mq]: second.patch' (glob)
+  default         (*)* changes to: [mq]: second.patch (glob)
   
   diff --git a/a/a b/a/a
   --- a/a/a
@@ -177,7 +177,7 @@
   unshelving change 'default-01'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 4:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
+  rebasing 4:32c69314e062 "changes to: [mq]: second.patch" (tip)
   merging a/a
 
   $ hg revert --all -q
@@ -299,7 +299,7 @@
   unshelving change 'default'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
+  rebasing 5:32c69314e062 "changes to: [mq]: second.patch" (tip)
   merging a/a
   warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
@@ -329,7 +329,7 @@
    c
   +=======
   +a
-  +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
+  +>>>>>>> source: 32c69314e062 - shelve: changes to: [mq]: second.patch
   diff --git a/b/b b/b.rename/b
   rename from b/b
   rename to b.rename/b
@@ -402,7 +402,7 @@
   [255]
 
   $ hg unshelve -c
-  rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
+  rebasing 5:32c69314e062 "changes to: [mq]: second.patch" (tip)
   unshelve of 'default' complete
 
 ensure the repo is as we hope
@@ -473,12 +473,12 @@
   unshelving change 'default'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
+  rebasing 6:2f694dd83a13 "changes to: second" (tip)
   merging a/a
   $ hg parents -q
   4:33f7f61e6c5e
   $ hg shelve -l
-  default         (*)* changes to 'second' (glob)
+  default         (*)* changes to: second (glob)
   $ hg status
   M a/a
   A foo/foo
@@ -496,9 +496,9 @@
   unshelving change 'default'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
+  rebasing 6:2f694dd83a13 "changes to: second" (tip)
   merging a/a
-  note: rebase of 6:c5e6910e7601 created no changes to commit
+  note: rebase of 6:2f694dd83a13 created no changes to commit
   $ hg parents -q
   4:33f7f61e6c5e
   $ hg shelve -l
@@ -515,11 +515,11 @@
   shelved as default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg shelve --list
-  default         (*)    changes to 'create conflict' (glob)
+  default         (*)* changes to: create conflict (glob)
   $ hg unshelve -k
   unshelving change 'default'
   $ hg shelve --list
-  default         (*)    changes to 'create conflict' (glob)
+  default         (*)* changes to: create conflict (glob)
   $ hg shelve --cleanup
   $ hg shelve --list
 
@@ -554,7 +554,7 @@
   shelved as test
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg --config extensions.mq=! shelve --list
-  test            (*)    changes to 'create conflict' (glob)
+  test            (*)* changes to: create conflict (glob)
   $ hg bookmark
    * test                      4:33f7f61e6c5e
   $ hg --config extensions.mq=! unshelve
@@ -587,7 +587,7 @@
   $ hg unshelve
   unshelving change 'default'
   rebasing shelved changes
-  rebasing 4:b8fefe789ed0 "changes to 'xyz'" (tip)
+  rebasing 4:82a0d7d6ba61 "changes to: xyz" (tip)
   $ hg status
   M z
 
@@ -614,7 +614,7 @@
   $ hg unshelve
   unshelving change 'default'
   rebasing shelved changes
-  rebasing 3:0cae6656c016 "changes to 'c'" (tip)
+  rebasing 3:958bcbd1776e "changes to: c" (tip)
   $ hg status
   A d
 
@@ -628,7 +628,7 @@
   $ hg unshelve
   unshelving change 'default'
   rebasing shelved changes
-  rebasing 3:be58f65f55fb "changes to 'b'" (tip)
+  rebasing 3:013284d9655e "changes to: b" (tip)
   $ hg status
   A d
 
@@ -711,7 +711,7 @@
   shelved as default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg log -G --template '{rev}  {desc|firstline}  {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
-  o  4  changes to 'commit stuff'  shelve@localhost
+  o  4  changes to: commit stuff  shelve@localhost
   |
   $ hg log -G --template '{rev}  {desc|firstline}  {author}'
   @  3  commit stuff  test
@@ -726,13 +726,13 @@
   unshelving change 'default'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
+  rebasing 5:81152db69da7 "changes to: commit stuff" (tip)
   merging f
   warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
   [1]
   $ hg log -G --template '{rev}  {desc|firstline}  {author}  {date|isodate}'
-  @  5  changes to 'commit stuff'  shelve@localhost  1970-01-01 00:00 +0000
+  @  5  changes to: commit stuff  shelve@localhost  1970-01-01 00:00 +0000
   |
   | @  4  pending changes temporary commit  shelve@localhost  2004-01-10 13:37 +0000
   |/
@@ -750,7 +750,7 @@
   g
   =======
   f
-  >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
+  >>>>>>> source: 81152db69da7 - shelve: changes to: commit stuff
   $ cat f.orig
   g
   $ hg unshelve --abort -t false
@@ -766,7 +766,7 @@
   unshelving change 'default'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
+  rebasing 5:81152db69da7 "changes to: commit stuff" (tip)
   $ hg st
   M a
   A f
@@ -782,7 +782,7 @@
   $ hg unshelve
   unshelving change 'default'
   rebasing shelved changes
-  rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
+  rebasing 5:81152db69da7 "changes to: commit stuff" (tip)
   merging f
   warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
@@ -795,7 +795,7 @@
   g
   =======
   f
-  >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
+  >>>>>>> source: 81152db69da7 - shelve: changes to: commit stuff
   $ cat f.orig
   g
   $ hg unshelve --abort
@@ -825,7 +825,7 @@
   $ hg unshelve
   unshelving change 'default'
   rebasing shelved changes
-  rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
+  rebasing 5:e42a7da90865 "changes to: second" (tip)
   merging a/a
   warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
@@ -841,8 +841,8 @@
   $ hg resolve -m a/a
   (no more unresolved files)
   $ hg unshelve -c
-  rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
-  note: rebase of 5:4b555fdb4e96 created no changes to commit
+  rebasing 5:e42a7da90865 "changes to: second" (tip)
+  note: rebase of 5:e42a7da90865 created no changes to commit
   unshelve of 'default' complete
   $ hg bookmark
    * test                      4:33f7f61e6c5e
@@ -935,7 +935,7 @@
   unshelving change 'test'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 6:65b5d1c34c34 "changes to 'create conflict'" (tip)
+  rebasing 6:96a1354f65f6 "changes to: create conflict" (tip)
   merging a/a
   $ hg bookmark
    * test                      4:33f7f61e6c5e
@@ -969,7 +969,7 @@
   abort: --stat expects a single shelf
   [255]
   $ hg shelve --patch default
-  default         (* ago)    changes to 'create conflict' (glob)
+  default         (*)* changes to: create conflict (glob)
   
   diff --git a/shelf-patch-a b/shelf-patch-a
   new file mode 100644
@@ -978,7 +978,7 @@
   @@ -0,0 +1,1 @@
   +patch a
   $ hg shelve --stat default
-  default         (* ago)    changes to 'create conflict' (glob)
+  default         (*)* changes to: create conflict (glob)
    shelf-patch-a |  1 +
    1 files changed, 1 insertions(+), 0 deletions(-)
   $ hg shelve --patch nonexistentshelf
@@ -1010,7 +1010,7 @@
   shelved as default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg debugbundle .hg/shelved/*.hg
-  7e30d8ac6f23cfc84330fd7e698730374615d21a
+  45993d65fe9dc3c6d8764b9c3b07fa831ee7d92d
   $ cd ..
 
 with general delta
@@ -1032,7 +1032,7 @@
   $ hg debugbundle .hg/shelved/*.hg
   Stream params: {'Compression': 'BZ'}
   changegroup -- "{'version': '02'}"
-      7e30d8ac6f23cfc84330fd7e698730374615d21a
+      45993d65fe9dc3c6d8764b9c3b07fa831ee7d92d
   $ cd ..
 
 Test visibility of in-memory changes inside transaction to external hook
@@ -1086,13 +1086,13 @@
   $ hg unshelve --keep default
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 7:fcbb97608399 "changes to 'create conflict'" (tip)
+  rebasing 7:206bf5d4f922 "changes to: create conflict" (tip)
   ==== preupdate:
   VISIBLE 6:66b86db80ee4
   ACTUAL  5:703117a2acfb
   ====
   ==== preupdate:
-  VISIBLE 8:cb2a4e59c2d5
+  VISIBLE 8:a0e04704317e
   ACTUAL  5:703117a2acfb
   ====
   ==== preupdate:
@@ -1131,10 +1131,10 @@
   $ hg unshelve --keep default
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
-  rebasing 7:fcbb97608399 "changes to 'create conflict'" (tip)
+  rebasing 7:206bf5d4f922 "changes to: create conflict" (tip)
   ==== update:
   VISIBLE 6:66b86db80ee4
-  VISIBLE 7:fcbb97608399
+  VISIBLE 7:206bf5d4f922
   ACTUAL  5:703117a2acfb
   ====
   ==== update: