changeset 39376:5f8282f368b2

shelve: add an "internal" extra Keeping shelve changeset around increase the risk of collision with normal changesets. To prevent such collision and help with overall clarity, we add an 'internal' key in extra that mark the changeset as created by "shelve". Node changes in tests are expected.
author Boris Feld <boris.feld@octobus.net>
date Wed, 06 Jun 2018 01:46:37 +0200
parents 38373da1af02
children b4e7e1f09c09
files hgext/shelve.py tests/test-shelve.t
diffstat 2 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Wed Jun 06 01:10:01 2018 +0200
+++ b/hgext/shelve.py	Wed Jun 06 01:46:37 2018 +0200
@@ -463,7 +463,7 @@
 
         name = getshelvename(repo, parent, opts)
         activebookmark = _backupactivebookmark(repo)
-        extra = {}
+        extra = {'internal': 'shelve'}
         if includeunknown:
             _includeunknownfiles(repo, pats, opts, extra)
 
@@ -751,7 +751,8 @@
         return tmpwctx, addedbefore
     ui.status(_("temporarily committing pending changes "
                 "(restore with 'hg unshelve --abort')\n"))
-    commitfunc = getcommitfunc(extra=None, interactive=False,
+    extra = {'internal': 'shelve'}
+    commitfunc = getcommitfunc(extra=extra, interactive=False,
                                editor=False)
     tempopts = {}
     tempopts['message'] = "pending changes temporary commit"
--- a/tests/test-shelve.t	Wed Jun 06 01:10:01 2018 +0200
+++ b/tests/test-shelve.t	Wed Jun 06 01:46:37 2018 +0200
@@ -387,11 +387,11 @@
   +++ b/a/a
   @@ -1,2 +1,6 @@
    a
-  +<<<<<<< shelve:       562f7831e574 - shelve: pending changes temporary commit
+  +<<<<<<< shelve:       2377350b6337 - shelve: pending changes temporary commit
    c
   +=======
   +a
-  +>>>>>>> working-copy: 32c69314e062 - shelve: changes to: [mq]: second.patch
+  +>>>>>>> working-copy: a68ec3400638 - shelve: changes to: [mq]: second.patch
   diff --git a/b/b b/b.rename/b
   rename from b/b
   rename to b.rename/b
@@ -809,11 +809,11 @@
   M f
   ? f.orig
   $ cat f
-  <<<<<<< shelve:       5f6b880e719b - shelve: pending changes temporary commit
+  <<<<<<< shelve:       d44eae5c3d33 - shelve: pending changes temporary commit
   g
   =======
   f
-  >>>>>>> working-copy: 81152db69da7 - shelve: changes to: commit stuff
+  >>>>>>> working-copy: aef214a5229c - shelve: changes to: commit stuff
   $ cat f.orig
   g
   $ hg unshelve --abort -t false
@@ -855,7 +855,7 @@
   g
   =======
   f
-  >>>>>>> working-copy: 81152db69da7 - shelve: changes to: commit stuff
+  >>>>>>> working-copy: aef214a5229c - shelve: changes to: commit stuff
   $ cat f.orig
   g
   $ hg unshelve --abort
@@ -1117,7 +1117,7 @@
   shelved as default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg debugbundle .hg/shelved/*.hg
-  45993d65fe9dc3c6d8764b9c3b07fa831ee7d92d
+  330882a04d2ce8487636b1fb292e5beea77fa1e3
   $ cd ..
 
 with general delta
@@ -1140,7 +1140,7 @@
   $ hg debugbundle .hg/shelved/*.hg
   Stream params: {Compression: BZ}
   changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
-      45993d65fe9dc3c6d8764b9c3b07fa831ee7d92d
+      330882a04d2ce8487636b1fb292e5beea77fa1e3
   $ cd ..
 
 Test visibility of in-memory changes inside transaction to external hook
@@ -1195,15 +1195,15 @@
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
   ==== preupdate:
-  VISIBLE 6:66b86db80ee4
+  VISIBLE 6:54c00d20fb3f
   ACTUAL  5:703117a2acfb
   ====
   ==== preupdate:
-  VISIBLE 8:92fdbb7b4de7
+  VISIBLE 8:8efe6f7537dc
   ACTUAL  5:703117a2acfb
   ====
   ==== preupdate:
-  VISIBLE 6:66b86db80ee4
+  VISIBLE 6:54c00d20fb3f
   ACTUAL  5:703117a2acfb
   ====
 
@@ -1239,12 +1239,12 @@
   temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
   ==== update:
-  VISIBLE 6:66b86db80ee4
-  VISIBLE 7:206bf5d4f922
+  VISIBLE 6:54c00d20fb3f
+  VISIBLE 7:492ed9d705e5
   ACTUAL  5:703117a2acfb
   ====
   ==== update:
-  VISIBLE 6:66b86db80ee4
+  VISIBLE 6:54c00d20fb3f
   ACTUAL  5:703117a2acfb
   ====
   ==== update:
@@ -1780,8 +1780,8 @@
   > ashelve
   > 8b058dae057a5a78f393f4535d9e363dd5efac9d
   > 8b058dae057a5a78f393f4535d9e363dd5efac9d
-  > 8b058dae057a5a78f393f4535d9e363dd5efac9d 003d2d94241cc7aff0c3a148e966d6a4a377f3a7
-  > 003d2d94241cc7aff0c3a148e966d6a4a377f3a7
+  > 8b058dae057a5a78f393f4535d9e363dd5efac9d f543b27db2cdb41737e2e0008dc524c471da1446
+  > f543b27db2cdb41737e2e0008dc524c471da1446
   > 
   > nokeep
   > :no-active-bookmark