mercurial/archival.py
changeset 25690 98064baab877
parent 25675 c76e8d14383a
child 25695 ce3d4b858420
--- a/mercurial/archival.py	Mon Jun 29 10:34:56 2015 -0400
+++ b/mercurial/archival.py	Wed Jul 01 15:12:45 2015 -0500
@@ -86,7 +86,11 @@
         ltags, dist = repo.ui.popbuffer().split('\n')
         ltags = ltags.split(':')
         # XXX: ctx.rev() needs to be handled differently with wdir()
-        changessince = len(repo.revs('only(%d,%s)', ctx.rev(), ltags[0]))
+        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