mercurial/archival.py
changeset 25615 dc707fb35550
parent 25601 3ec8351fa6ed
child 25658 e93036747902
equal deleted inserted replaced
25614:6c48f012d37e 25615:dc707fb35550
    65     return repo['null']
    65     return repo['null']
    66 
    66 
    67 def buildmetadata(ctx):
    67 def buildmetadata(ctx):
    68     '''build content of .hg_archival.txt'''
    68     '''build content of .hg_archival.txt'''
    69     repo = ctx.repo()
    69     repo = ctx.repo()
       
    70     hex = ctx.hex()
       
    71     if ctx.rev() is None:
       
    72         hex = ctx.p1().hex()
       
    73         if ctx.dirty():
       
    74             hex += '+'
       
    75 
    70     base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
    76     base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
    71         _rootctx(repo).hex(), ctx.hex(), encoding.fromlocal(ctx.branch()))
    77         _rootctx(repo).hex(), hex, encoding.fromlocal(ctx.branch()))
    72 
    78 
    73     tags = ''.join('tag: %s\n' % t for t in ctx.tags()
    79     tags = ''.join('tag: %s\n' % t for t in ctx.tags()
    74                    if repo.tagtype(t) == 'global')
    80                    if repo.tagtype(t) == 'global')
    75     if not tags:
    81     if not tags:
    76         repo.ui.pushbuffer()
    82         repo.ui.pushbuffer()