shelve: return the shelved node as part of bundle application
It make sense to have the function in charge of unbundling the shelved revision
also return the node of that revision (when the data is in the bundle).
This will help us to handle unnatural state where the unshelved change already
exists in the repository.
--- a/hgext/shelve.py Thu Sep 20 11:18:28 2018 +0200
+++ b/hgext/shelve.py Wed Sep 19 12:19:28 2018 +0200
@@ -148,6 +148,7 @@
source='unshelve',
url='bundle:' + self.vfs.join(self.fname),
targetphase=targetphase)
+ return self.repo['tip']
finally:
fp.close()
@@ -791,8 +792,7 @@
node = shelvedfile(repo, basename, 'shelve').readinfo()['node']
if node is None or node not in repo:
with ui.configoverride({('ui', 'quiet'): True}):
- shelvedfile(repo, basename, 'hg').applybundle()
- shelvectx = repo['tip']
+ shelvectx = shelvedfile(repo, basename, 'hg').applybundle()
# 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: