299 ui.write("\n") |
299 ui.write("\n") |
300 if maxnr and count >= maxnr: |
300 if maxnr and count >= maxnr: |
301 break |
301 break |
302 count += 1 |
302 count += 1 |
303 |
303 |
304 @command('debug-rev-parse', |
|
305 [('', 'default', '', _('ignored'))], |
|
306 _('REV')) |
|
307 def revparse(ui, repo, *revs, **opts): |
|
308 """parse given revisions""" |
|
309 def revstr(rev): |
|
310 if rev == 'HEAD': |
|
311 rev = 'tip' |
|
312 return revlog.hex(repo.lookup(rev)) |
|
313 |
|
314 for r in revs: |
|
315 revrange = r.split(':', 1) |
|
316 ui.write('%s\n' % revstr(revrange[0])) |
|
317 if len(revrange) == 2: |
|
318 ui.write('^%s\n' % revstr(revrange[1])) |
|
319 |
|
320 # git rev-list tries to order things by date, and has the ability to stop |
304 # git rev-list tries to order things by date, and has the ability to stop |
321 # at a given commit without walking the whole repo. TODO add the stop |
305 # at a given commit without walking the whole repo. TODO add the stop |
322 # parameter |
306 # parameter |
323 @command('debug-rev-list', |
307 @command('debug-rev-list', |
324 [('H', 'header', None, _('header')), |
308 [('H', 'header', None, _('header')), |