Patchwork [6,of,9] shelve: add 'changes to' prefix to default shelve message

login
register
mail settings
Submitter Mads Kiilerich
Date Feb. 10, 2014, 12:01 a.m.
Message ID <1551c9dd865de3a336f3.1391990475@localhost.localdomain>
Download mbox | patch
Permalink /patch/3530/
State Accepted
Commit 66359d8b8d7e1d92154a46d2384ef5ba581b0b3b
Headers show

Comments

Mads Kiilerich - Feb. 10, 2014, 12:01 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1391990007 -3600
#      Mon Feb 10 00:53:27 2014 +0100
# Node ID 1551c9dd865de3a336f36991ed35a76a975eaf3d
# Parent  5d873a5e38865e6f2017e8e9ece3f4fd92f5a131
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.

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -172,9 +172,9 @@  def createcmd(ui, repo, pats, opts):
                 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
diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -81,11 +81,11 @@  the common case - no options or filename
 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 @@  test keep and cleanup
   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 @@  test keep and cleanup
   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 @@  shelve should still work even if mq is d
   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