changeset 39402:38373da1af02

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).
author Boris Feld <boris.feld@octobus.net>
date Wed, 06 Jun 2018 01:10:01 +0200
parents c67c94c0e7ae
children 5f8282f368b2
files hgext/shelve.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Wed Jun 06 00:57:22 2018 +0200
+++ b/hgext/shelve.py	Wed Jun 06 01:10:01 2018 +0200
@@ -770,6 +770,11 @@
         with ui.configoverride({('ui', 'quiet'): True}):
             shelvedfile(repo, basename, 'hg').applybundle()
         shelvectx = repo['tip']
+        # We might not 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]