# HG changeset patch # User Matt Harbison # Date 1435723009 14400 # Node ID f5f43178bdde98f0ffd5aa3f2d3cede974d9b95f # Parent 4474a750413fafc07659fbdd55adc68316820e04 archive: use {changessincelatesttag} to build the metadata file This isolates the current magic when dealing with wdir() and only(). diff -r 4474a750413f -r f5f43178bdde mercurial/archival.py --- 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