shelve: add 'changes to' prefix to default shelve message
authorMads Kiilerich <madski@unity3d.com>
Mon, 10 Feb 2014 00:53:27 +0100
changeset 20411 66359d8b8d7e
parent 20410 fc5354648224
child 20412 e584fc30456b
shelve: add 'changes to' prefix to default shelve message The shelved changes _could_ perhaps be amended to the parent changeset but it _is_ not the parent changeset. Using the description from the parent changeset is thus wrong and confusing. Instead, add a 'changes to' prefix.
hgext/shelve.py
tests/test-shelve.t
--- a/hgext/shelve.py	Mon Feb 10 00:53:27 2014 +0100
+++ b/hgext/shelve.py	Mon Feb 10 00:53:27 2014 +0100
@@ -172,9 +172,9 @@
                 repo.mq.checkapplied = saved
 
     if parent.node() != nullid:
-        desc = parent.description().split('\n', 1)[0]
+        desc = "changes to '%s'" % parent.description().split('\n', 1)[0]
     else:
-        desc = '(empty repository)'
+        desc = '(changes in empty repository)'
 
     if not opts['message']:
         opts['message'] = desc
--- a/tests/test-shelve.t	Mon Feb 10 00:53:27 2014 +0100
+++ b/tests/test-shelve.t	Mon Feb 10 00:53:27 2014 +0100
@@ -81,11 +81,11 @@
 ensure that our shelved changes exist
 
   $ hg shelve -l
-  default-01      (*)    [mq]: second.patch (glob)
-  default         (*)    [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         (*)    [mq]: second.patch (glob)
+  default         (*)    changes to '[mq]: second.patch' (glob)
   
   diff --git a/a/a b/a/a
   --- a/a/a
@@ -400,7 +400,7 @@
   shelved as default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg shelve --list
-  default         (*)    create conflict (glob)
+  default         (*)    changes to 'create conflict' (glob)
   $ hg unshelve --keep
   unshelving change 'default'
   adding changesets
@@ -408,7 +408,7 @@
   adding file changes
   added 1 changesets with 1 changes to 7 files
   $ hg shelve --list
-  default         (*)    create conflict (glob)
+  default         (*)    changes to 'create conflict' (glob)
   $ hg shelve --cleanup
   $ hg shelve --list
 
@@ -437,7 +437,7 @@
   shelved as test
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg --config extensions.mq=! shelve --list
-  test            (1s ago)    create conflict
+  test            (*)    changes to 'create conflict' (glob)
   $ hg --config extensions.mq=! unshelve
   unshelving change 'test'
   adding changesets