Comments
Patch
@@ -67,8 +67,11 @@
def buildmetadata(ctx):
'''build content of .hg_archival.txt'''
repo = ctx.repo()
+ hex = ctx.hex()
+ if ctx.rev() is None:
+ hex = ctx.p1().hex() + '+'
base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
- _rootctx(repo).hex(), ctx.hex(), encoding.fromlocal(ctx.branch()))
+ _rootctx(repo).hex(), hex, encoding.fromlocal(ctx.branch()))
tags = ''.join('tag: %s\n' % t for t in ctx.tags()
if repo.tagtype(t) == 'global')
@@ -187,6 +187,14 @@
../wdir/sub1/sub2/folder/test.txt
../wdir/sub1/sub2/sub2
+ $ cat ../wdir/.hg_archival.txt
+ repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
+ node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
+ branch: default
+ latesttag: null
+ latesttagdistance: 4
+ changessincelatesttag: 3
+
Attempting to archive 'wdir()' with a missing file is handled gracefully
$ rm sub1/sub1
$ rm -r ../wdir