Mercurial > hg-stable
changeset 25725:f5f43178bdde
archive: use {changessincelatesttag} to build the metadata file
This isolates the current magic when dealing with wdir() and only().
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 30 Jun 2015 23:56:49 -0400 |
parents | 4474a750413f |
children | b44e483726d3 |
files | mercurial/archival.py |
diffstat | 1 files changed, 3 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/archival.py Fri Jun 26 23:11:05 2015 -0400 +++ b/mercurial/archival.py Tue Jun 30 23:56:49 2015 -0400 @@ -80,16 +80,12 @@ if repo.tagtype(t) == 'global') if not tags: repo.ui.pushbuffer() - opts = {'template': '{latesttag}\n{latesttagdistance}', + opts = {'template': '{latesttag}\n{latesttagdistance}\n' + '{changessincelatesttag}', 'style': '', 'patch': None, 'git': None} cmdutil.show_changeset(repo.ui, repo, opts).show(ctx) - ltags, dist = repo.ui.popbuffer().split('\n') + ltags, dist, changessince = repo.ui.popbuffer().split('\n') ltags = ltags.split(':') - if ctx.rev() is None: - changessince = len(repo.revs('only(%d,%s)', ctx.p1(), - ltags[0])) + 1 - else: - changessince = len(repo.revs('only(%d,%s)', ctx.rev(), ltags[0])) tags = ''.join('latesttag: %s\n' % t for t in ltags) tags += 'latesttagdistance: %s\n' % dist tags += 'changessincelatesttag: %s\n' % changessince