##// END OF EJS Templates
archive: fix changesincelatesttag with wdir()
Matt Mackall -
r25690:98064baa default
parent child Browse files
Show More
@@ -86,7 +86,11 b' def buildmetadata(ctx):'
86 ltags, dist = repo.ui.popbuffer().split('\n')
86 ltags, dist = repo.ui.popbuffer().split('\n')
87 ltags = ltags.split(':')
87 ltags = ltags.split(':')
88 # XXX: ctx.rev() needs to be handled differently with wdir()
88 # XXX: ctx.rev() needs to be handled differently with wdir()
89 changessince = len(repo.revs('only(%d,%s)', ctx.rev(), ltags[0]))
89 if ctx.rev() is None:
90 changessince = len(repo.revs('only(%d,%s)', ctx.p1(),
91 ltags[0])) + 1
92 else:
93 changessince = len(repo.revs('only(%d,%s)', ctx.rev(), ltags[0]))
90 tags = ''.join('latesttag: %s\n' % t for t in ltags)
94 tags = ''.join('latesttag: %s\n' % t for t in ltags)
91 tags += 'latesttagdistance: %s\n' % dist
95 tags += 'latesttagdistance: %s\n' % dist
92 tags += 'changessincelatesttag: %s\n' % changessince
96 tags += 'changessincelatesttag: %s\n' % changessince
@@ -193,7 +193,7 b' Archive wdir() with subrepos'
193 branch: default
193 branch: default
194 latesttag: null
194 latesttag: null
195 latesttagdistance: 4
195 latesttagdistance: 4
196 changessincelatesttag: 3
196 changessincelatesttag: 4
197
197
198 Attempting to archive 'wdir()' with a missing file is handled gracefully
198 Attempting to archive 'wdir()' with a missing file is handled gracefully
199 $ rm sub1/sub1
199 $ rm sub1/sub1
@@ -220,7 +220,7 b' Continue relative path printing + subrep'
220 branch: default
220 branch: default
221 latesttag: null
221 latesttag: null
222 latesttagdistance: 4
222 latesttagdistance: 4
223 changessincelatesttag: 3
223 changessincelatesttag: 4
224
224
225 $ touch sub1/sub2/folder/bar
225 $ touch sub1/sub2/folder/bar
226 $ hg addremove sub1/sub2
226 $ hg addremove sub1/sub2
General Comments 0
You need to be logged in to leave comments. Login now