comparison hgext/shelve.py @ 39375: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
comparison
equal deleted inserted replaced
39374:c67c94c0e7ae 39375:38373da1af02
768 node = shelvedfile(repo, basename, 'shelve').readinfo()['node'] 768 node = shelvedfile(repo, basename, 'shelve').readinfo()['node']
769 if node is None or node not in repo: 769 if node is None or node not in repo:
770 with ui.configoverride({('ui', 'quiet'): True}): 770 with ui.configoverride({('ui', 'quiet'): True}):
771 shelvedfile(repo, basename, 'hg').applybundle() 771 shelvedfile(repo, basename, 'hg').applybundle()
772 shelvectx = repo['tip'] 772 shelvectx = repo['tip']
773 # We might not strip the unbundled changeset, so we should keep track of
774 # the unshelve node in case we need to reuse it (eg: unshelve --keep)
775 if node is None:
776 info = {'node': nodemod.hex(node)}
777 shelvedfile(repo, basename, 'shelve').writeinfo(info)
773 else: 778 else:
774 shelvectx = repo[node] 779 shelvectx = repo[node]
775 780
776 return repo, shelvectx 781 return repo, shelvectx
777 782