Mercurial > hg
comparison hgext/hgk.py @ 24511:0ecc1e42ff3f
hgk: remove repetitious (and wrong) command syntax descriptions
author | Andrew Shadura <andrew@shadura.me> |
---|---|
date | Sat, 28 Mar 2015 19:34:03 +0100 |
parents | 5fb1fc2e1281 |
children | e5c5ddc3b172 |
comparison
equal
deleted
inserted
replaced
24510:8d6fd0b8f622 | 24511:0ecc1e42ff3f |
---|---|
48 ('r', 'recursive', None, _('recursive')), | 48 ('r', 'recursive', None, _('recursive')), |
49 ('P', 'pretty', None, _('pretty')), | 49 ('P', 'pretty', None, _('pretty')), |
50 ('s', 'stdin', None, _('stdin')), | 50 ('s', 'stdin', None, _('stdin')), |
51 ('C', 'copy', None, _('detect copies')), | 51 ('C', 'copy', None, _('detect copies')), |
52 ('S', 'search', "", _('search'))], | 52 ('S', 'search', "", _('search'))], |
53 ('hg git-diff-tree [OPTION]... NODE1 NODE2 [FILE]...'), | 53 ('[OPTION]... NODE1 NODE2 [FILE]...'), |
54 inferrepo=True) | 54 inferrepo=True) |
55 def difftree(ui, repo, node1=None, node2=None, *files, **opts): | 55 def difftree(ui, repo, node1=None, node2=None, *files, **opts): |
56 """diff trees from two commits""" | 56 """diff trees from two commits""" |
57 def __difftree(repo, node1, node2, files=[]): | 57 def __difftree(repo, node1, node2, files=[]): |
58 assert node2 is not None | 58 assert node2 is not None |
136 else: | 136 else: |
137 ui.write(description + "\n") | 137 ui.write(description + "\n") |
138 if prefix: | 138 if prefix: |
139 ui.write('\0') | 139 ui.write('\0') |
140 | 140 |
141 @command('debug-merge-base', [], _('hg debug-merge-base REV REV')) | 141 @command('debug-merge-base', [], _('REV REV')) |
142 def base(ui, repo, node1, node2): | 142 def base(ui, repo, node1, node2): |
143 """output common ancestor information""" | 143 """output common ancestor information""" |
144 node1 = repo.lookup(node1) | 144 node1 = repo.lookup(node1) |
145 node2 = repo.lookup(node2) | 145 node2 = repo.lookup(node2) |
146 n = repo.changelog.ancestor(node1, node2) | 146 n = repo.changelog.ancestor(node1, node2) |
147 ui.write(short(n) + "\n") | 147 ui.write(short(n) + "\n") |
148 | 148 |
149 @command('debug-cat-file', | 149 @command('debug-cat-file', |
150 [('s', 'stdin', None, _('stdin'))], | 150 [('s', 'stdin', None, _('stdin'))], |
151 _('hg debug-cat-file [OPTION]... TYPE FILE'), | 151 _('[OPTION]... TYPE FILE'), |
152 inferrepo=True) | 152 inferrepo=True) |
153 def catfile(ui, repo, type=None, r=None, **opts): | 153 def catfile(ui, repo, type=None, r=None, **opts): |
154 """cat a specific revision""" | 154 """cat a specific revision""" |
155 # in stdin mode, every line except the commit is prefixed with two | 155 # in stdin mode, every line except the commit is prefixed with two |
156 # spaces. This way the our caller can find the commit without magic | 156 # spaces. This way the our caller can find the commit without magic |
298 break | 298 break |
299 count += 1 | 299 count += 1 |
300 | 300 |
301 @command('debug-rev-parse', | 301 @command('debug-rev-parse', |
302 [('', 'default', '', _('ignored'))], | 302 [('', 'default', '', _('ignored'))], |
303 _('hg debug-rev-parse REV')) | 303 _('REV')) |
304 def revparse(ui, repo, *revs, **opts): | 304 def revparse(ui, repo, *revs, **opts): |
305 """parse given revisions""" | 305 """parse given revisions""" |
306 def revstr(rev): | 306 def revstr(rev): |
307 if rev == 'HEAD': | 307 if rev == 'HEAD': |
308 rev = 'tip' | 308 rev = 'tip' |
320 @command('debug-rev-list', | 320 @command('debug-rev-list', |
321 [('H', 'header', None, _('header')), | 321 [('H', 'header', None, _('header')), |
322 ('t', 'topo-order', None, _('topo-order')), | 322 ('t', 'topo-order', None, _('topo-order')), |
323 ('p', 'parents', None, _('parents')), | 323 ('p', 'parents', None, _('parents')), |
324 ('n', 'max-count', 0, _('max-count'))], | 324 ('n', 'max-count', 0, _('max-count'))], |
325 ('hg debug-rev-list [OPTION]... REV...')) | 325 ('[OPTION]... REV...')) |
326 def revlist(ui, repo, *revs, **opts): | 326 def revlist(ui, repo, *revs, **opts): |
327 """print revisions""" | 327 """print revisions""" |
328 if opts['header']: | 328 if opts['header']: |
329 full = "commit" | 329 full = "commit" |
330 else: | 330 else: |
342 | 342 |
343 | 343 |
344 @command('view', | 344 @command('view', |
345 [('l', 'limit', '', | 345 [('l', 'limit', '', |
346 _('limit number of changes displayed'), _('NUM'))], | 346 _('limit number of changes displayed'), _('NUM'))], |
347 _('hg view [-l LIMIT] [REVRANGE]')) | 347 _('[-l LIMIT] [REVRANGE]')) |
348 def view(ui, repo, *etc, **opts): | 348 def view(ui, repo, *etc, **opts): |
349 "start interactive history viewer" | 349 "start interactive history viewer" |
350 os.chdir(repo.root) | 350 os.chdir(repo.root) |
351 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v]) | 351 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v]) |
352 cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc)) | 352 cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc)) |