33 def simpledepth(repo, rev): |
33 def simpledepth(repo, rev): |
34 """simple but obviously right implementation of depth""" |
34 """simple but obviously right implementation of depth""" |
35 return len(repo.revs('::%d', rev)) |
35 return len(repo.revs('::%d', rev)) |
36 |
36 |
37 @eh.command( |
37 @eh.command( |
38 'debugdepth', |
38 b'debugdepth', |
39 [ |
39 [ |
40 ('r', 'rev', [], 'revs to print depth for'), |
40 (b'r', b'rev', [], b'revs to print depth for'), |
41 ('', 'method', 'cached', "one of 'simple', 'cached', 'compare'"), |
41 (b'', b'method', b'cached', b"one of 'simple', 'cached', 'compare'"), |
42 ], |
42 ], |
43 _('REVS')) |
43 _(b'REVS')) |
44 def debugdepth(ui, repo, **opts): |
44 def debugdepth(ui, repo, **opts): |
45 """display depth of REVS |
45 """display depth of REVS |
46 """ |
46 """ |
47 revs = scmutil.revrange(repo, opts['rev']) |
47 revs = scmutil.revrange(repo, opts['rev']) |
48 method = opts['method'] |
48 method = opts['method'] |