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).
--- 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]