diff hgext/shelve.py @ 39399:da121c9dc0f2

shelve: store shelved node in a new data file It is useful for a version of shelve not based on bundle and strip. Having more data does not hurt the bundle based case so we introduce it in all cases before doing more rework. We also keep storing the patch using another method. note: We could have this metadata file list all the file involved in the shelve and use that for cleanup. This would be more future proof than having a hard-coded list of file to purge. However, this is an adventure for another series.
author Boris Feld <boris.feld@octobus.net>
date Tue, 29 May 2018 11:47:32 +0200
parents eecd68ca041d
children 6a71324cb68b
line wrap: on
line diff
--- a/hgext/shelve.py	Sun Aug 05 16:33:30 2018 +0900
+++ b/hgext/shelve.py	Tue May 29 11:47:32 2018 +0200
@@ -79,7 +79,7 @@
 
 backupdir = 'shelve-backup'
 shelvedir = 'shelved'
-shelvefileextensions = ['hg', 'patch']
+shelvefileextensions = ['hg', 'patch', 'shelve']
 # universal extension is present in all types of shelves
 patchextension = 'patch'
 
@@ -409,6 +409,8 @@
         ui.status(_("nothing changed\n"))
 
 def _shelvecreatedcommit(repo, node, name):
+    info = {'node': nodemod.hex(node)}
+    shelvedfile(repo, name, 'shelve').writeinfo(info)
     bases = list(mutableancestors(repo[node]))
     shelvedfile(repo, name, 'hg').writebundle(bases, node)
     with shelvedfile(repo, name, patchextension).opener('wb') as fp: