diff --git a/mercurial/archival.py b/mercurial/archival.py --- a/mercurial/archival.py +++ b/mercurial/archival.py @@ -276,8 +276,11 @@ def archive(repo, dest, node, kind, deco 'style': '', 'patch': None, 'git': None} cmdutil.show_changeset(repo.ui, repo, opts).show(ctx) ltags, dist = repo.ui.popbuffer().split('\n') - tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':')) + ltags = ltags.split(':') + changessince = len(repo.revs('only(.,%s)', ltags[0])) + tags = ''.join('latesttag: %s\n' % t for t in ltags) tags += 'latesttagdistance: %s\n' % dist + tags += 'changessincelatesttag: %s\n' % changessince return base + tags diff --git a/tests/test-archive.t b/tests/test-archive.t --- a/tests/test-archive.t +++ b/tests/test-archive.t @@ -250,6 +250,7 @@ test .hg_archival.txt branch: default latesttag: null latesttagdistance: 4 + changessincelatesttag: 4 $ hg tag -r 2 mytag $ hg tag -r 2 anothertag $ hg archive -r 2 ../test-lasttag @@ -322,10 +323,10 @@ old file -- date clamped to 1980 Archive: ../old.zip \s*Length.* (re) *-----* (glob) - *147*80*00:00*old/.hg_archival.txt (glob) + *172*80*00:00*old/.hg_archival.txt (glob) *0*80*00:00*old/old (glob) *-----* (glob) - \s*147\s+2 files (re) + \s*172\s+2 files (re) show an error when a provided pattern matches no files