[PATCH 07 of 10] shelve: write metadata file on the fly if they are missing

Boris Feld boris.feld at octobus.net
Wed Aug 29 12:30:55 EDT 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1528240201 -7200
#      Wed Jun 06 01:10:01 2018 +0200
# Node ID 95c87531a5cc2f5ee8efad0243bdcbe9a38d883a
# Parent  e56dd355b971632ef95fbbf07445547ea6d30f88
# EXP-Topic internal-phase.shelve
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 95c87531a5cc
shelve: write metadata file on the fly if they are missing

Keeping an explicit reference to the shelve node in order to reuse it directly
if the unshelved is repeated (eg: unshelve --keep).

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -770,6 +770,11 @@ def _unshelverestorecommit(ui, repo, bas
         with ui.configoverride({('ui', 'quiet'): True}):
             shelvedfile(repo, basename, 'hg').applybundle()
         shelvectx = repo['tip']
+        # We might no strip the unbundled changeset, so we should keep track of
+        # the unshelve node in case we need to reuse it (eg: unshelve --keep)
+        if node is None:
+            info = {'node': nodemod.hex(node)}
+            shelvedfile(repo, basename, 'shelve').writeinfo(info)
     else:
         shelvectx = repo[node]
 


More information about the Mercurial-devel mailing list