Show More
@@ -238,18 +238,19 b' class uibuffer(object):' | |||||
238 | class changeset_printer(object): |
|
238 | class changeset_printer(object): | |
239 | '''show changeset information when templating not requested.''' |
|
239 | '''show changeset information when templating not requested.''' | |
240 |
|
240 | |||
241 | def __init__(self, ui, repo, patch, buffered): |
|
241 | def __init__(self, ui, repo, patch, brinfo, buffered): | |
242 | self.ui = ui |
|
242 | self.ui = ui | |
243 | self.repo = repo |
|
243 | self.repo = repo | |
244 | self.buffered = buffered |
|
244 | self.buffered = buffered | |
245 | self.patch = patch |
|
245 | self.patch = patch | |
|
246 | self.brinfo = brinfo | |||
246 | if buffered: |
|
247 | if buffered: | |
247 | self.ui = uibuffer(ui) |
|
248 | self.ui = uibuffer(ui) | |
248 |
|
249 | |||
249 | def flush(self, rev): |
|
250 | def flush(self, rev): | |
250 | return self.ui.flush(rev) |
|
251 | return self.ui.flush(rev) | |
251 |
|
252 | |||
252 |
def show(self, rev=0, changenode=None, |
|
253 | def show(self, rev=0, changenode=None, copies=None): | |
253 | '''show a single changeset or file revision''' |
|
254 | '''show a single changeset or file revision''' | |
254 | if self.buffered: |
|
255 | if self.buffered: | |
255 | self.ui.mark(rev) |
|
256 | self.ui.mark(rev) | |
@@ -288,9 +289,10 b' class changeset_printer(object):' | |||||
288 | for parent in parents: |
|
289 | for parent in parents: | |
289 | self.ui.write(_("parent: %d:%s\n") % parent) |
|
290 | self.ui.write(_("parent: %d:%s\n") % parent) | |
290 |
|
291 | |||
291 | if brinfo and changenode in brinfo: |
|
292 | if self.brinfo: | |
292 |
br = |
|
293 | br = self.repo.branchlookup([changenode]) | |
293 | self.ui.write(_("branch: %s\n") % " ".join(br)) |
|
294 | if br: | |
|
295 | self.ui.write(_("branch: %s\n") % " ".join(br[changenode])) | |||
294 |
|
296 | |||
295 | if self.ui.debugflag: |
|
297 | if self.ui.debugflag: | |
296 | self.ui.write(_("manifest: %d:%s\n") % |
|
298 | self.ui.write(_("manifest: %d:%s\n") % | |
@@ -339,8 +341,8 b' class changeset_printer(object):' | |||||
339 | class changeset_templater(changeset_printer): |
|
341 | class changeset_templater(changeset_printer): | |
340 | '''format changeset information.''' |
|
342 | '''format changeset information.''' | |
341 |
|
343 | |||
342 | def __init__(self, ui, repo, patch, mapfile, buffered): |
|
344 | def __init__(self, ui, repo, patch, brinfo, mapfile, buffered): | |
343 | changeset_printer.__init__(self, ui, repo, patch, buffered) |
|
345 | changeset_printer.__init__(self, ui, repo, patch, brinfo, buffered) | |
344 | self.t = templater.templater(mapfile, templater.common_filters, |
|
346 | self.t = templater.templater(mapfile, templater.common_filters, | |
345 | cache={'parent': '{rev}:{node|short} ', |
|
347 | cache={'parent': '{rev}:{node|short} ', | |
346 | 'manifest': '{rev}:{node|short}', |
|
348 | 'manifest': '{rev}:{node|short}', | |
@@ -350,7 +352,7 b' class changeset_templater(changeset_prin' | |||||
350 | '''set template string to use''' |
|
352 | '''set template string to use''' | |
351 | self.t.cache['changeset'] = t |
|
353 | self.t.cache['changeset'] = t | |
352 |
|
354 | |||
353 |
def show(self, rev=0, changenode=None, |
|
355 | def show(self, rev=0, changenode=None, copies=[], **props): | |
354 | '''show a single changeset or file revision''' |
|
356 | '''show a single changeset or file revision''' | |
355 | if self.buffered: |
|
357 | if self.buffered: | |
356 | self.ui.mark(rev) |
|
358 | self.ui.mark(rev) | |
@@ -428,9 +430,11 b' class changeset_templater(changeset_prin' | |||||
428 | if branch: |
|
430 | if branch: | |
429 | return showlist('branch', [branch], plural='branches', **args) |
|
431 | return showlist('branch', [branch], plural='branches', **args) | |
430 | # add old style branches if requested |
|
432 | # add old style branches if requested | |
431 |
if |
|
433 | if self.brinfo: | |
432 |
|
|
434 | br = self.repo.branchlookup([changenode]) | |
433 | plural='branches', **args) |
|
435 | if changenode in br: | |
|
436 | return showlist('branch', br[changenode], | |||
|
437 | plural='branches', **args) | |||
434 |
|
438 | |||
435 | def showparents(**args): |
|
439 | def showparents(**args): | |
436 | parents = [[('rev', log.rev(p)), ('node', hex(p))] |
|
440 | parents = [[('rev', log.rev(p)), ('node', hex(p))] | |
@@ -555,6 +559,11 b' def show_changeset(ui, repo, opts, buffe' | |||||
555 | """ |
|
559 | """ | |
556 | # options |
|
560 | # options | |
557 | patch = opts.get('patch') |
|
561 | patch = opts.get('patch') | |
|
562 | br = None | |||
|
563 | if opts.get('branches'): | |||
|
564 | ui.warn(_("the --branches option is deprecated, " | |||
|
565 | "please use 'hg branches' instead\n")) | |||
|
566 | br = True | |||
558 | tmpl = opts.get('template') |
|
567 | tmpl = opts.get('template') | |
559 | mapfile = None |
|
568 | mapfile = None | |
560 | if tmpl: |
|
569 | if tmpl: | |
@@ -576,10 +585,10 b' def show_changeset(ui, repo, opts, buffe' | |||||
576 | or templater.templatepath(mapfile)) |
|
585 | or templater.templatepath(mapfile)) | |
577 | if mapname: mapfile = mapname |
|
586 | if mapname: mapfile = mapname | |
578 | try: |
|
587 | try: | |
579 | t = changeset_templater(ui, repo, patch, mapfile, buffered) |
|
588 | t = changeset_templater(ui, repo, patch, br, mapfile, buffered) | |
580 | except SyntaxError, inst: |
|
589 | except SyntaxError, inst: | |
581 | raise util.Abort(inst.args[0]) |
|
590 | raise util.Abort(inst.args[0]) | |
582 | if tmpl: t.use_template(tmpl) |
|
591 | if tmpl: t.use_template(tmpl) | |
583 | return t |
|
592 | return t | |
584 | return changeset_printer(ui, repo, patch, buffered) |
|
593 | return changeset_printer(ui, repo, patch, br, buffered) | |
585 |
|
594 |
@@ -703,7 +703,7 b' def bundle(ui, repo, fname, dest=None, *' | |||||
703 | # create the right base |
|
703 | # create the right base | |
704 | # XXX: nodesbetween / changegroup* should be "fixed" instead |
|
704 | # XXX: nodesbetween / changegroup* should be "fixed" instead | |
705 | o = [] |
|
705 | o = [] | |
706 |
has = {nullid: None} |
|
706 | has = {nullid: None} | |
707 | for n in base: |
|
707 | for n in base: | |
708 | has.update(repo.changelog.reachable(n)) |
|
708 | has.update(repo.changelog.reachable(n)) | |
709 | if revs: |
|
709 | if revs: | |
@@ -1434,14 +1434,9 b' def heads(ui, repo, **opts):' | |||||
1434 | heads = repo.heads(repo.lookup(opts['rev'])) |
|
1434 | heads = repo.heads(repo.lookup(opts['rev'])) | |
1435 | else: |
|
1435 | else: | |
1436 | heads = repo.heads() |
|
1436 | heads = repo.heads() | |
1437 | br = None |
|
|||
1438 | if opts['branches']: |
|
|||
1439 | ui.warn(_("the --branches option is deprecated, " |
|
|||
1440 | "please use 'hg branches' instead\n")) |
|
|||
1441 | br = repo.branchlookup(heads) |
|
|||
1442 | displayer = cmdutil.show_changeset(ui, repo, opts) |
|
1437 | displayer = cmdutil.show_changeset(ui, repo, opts) | |
1443 | for n in heads: |
|
1438 | for n in heads: | |
1444 |
displayer.show(changenode=n |
|
1439 | displayer.show(changenode=n) | |
1445 |
|
1440 | |||
1446 | def identify(ui, repo): |
|
1441 | def identify(ui, repo): | |
1447 | """print information about the working copy |
|
1442 | """print information about the working copy | |
@@ -1672,10 +1667,6 b' def log(ui, repo, *pats, **opts):' | |||||
1672 | getchange = util.cachefunc(lambda r:repo.changectx(r).changeset()) |
|
1667 | getchange = util.cachefunc(lambda r:repo.changectx(r).changeset()) | |
1673 | changeiter, matchfn = walkchangerevs(ui, repo, pats, getchange, opts) |
|
1668 | changeiter, matchfn = walkchangerevs(ui, repo, pats, getchange, opts) | |
1674 |
|
1669 | |||
1675 | if opts['branches']: |
|
|||
1676 | ui.warn(_("the --branches option is deprecated, " |
|
|||
1677 | "please use 'hg branches' instead\n")) |
|
|||
1678 |
|
||||
1679 | if opts['limit']: |
|
1670 | if opts['limit']: | |
1680 | try: |
|
1671 | try: | |
1681 | limit = int(opts['limit']) |
|
1672 | limit = int(opts['limit']) | |
@@ -1745,10 +1736,6 b' def log(ui, repo, *pats, **opts):' | |||||
1745 | if miss: |
|
1736 | if miss: | |
1746 | continue |
|
1737 | continue | |
1747 |
|
1738 | |||
1748 | br = None |
|
|||
1749 | if opts['branches']: |
|
|||
1750 | br = repo.branchlookup([repo.changelog.node(rev)]) |
|
|||
1751 |
|
||||
1752 | copies = [] |
|
1739 | copies = [] | |
1753 | if opts.get('copies') and rev: |
|
1740 | if opts.get('copies') and rev: | |
1754 | mf = getchange(rev)[0] |
|
1741 | mf = getchange(rev)[0] | |
@@ -1756,7 +1743,7 b' def log(ui, repo, *pats, **opts):' | |||||
1756 | rename = getrenamed(fn, rev, mf) |
|
1743 | rename = getrenamed(fn, rev, mf) | |
1757 | if rename: |
|
1744 | if rename: | |
1758 | copies.append((fn, rename[0])) |
|
1745 | copies.append((fn, rename[0])) | |
1759 |
displayer.show(rev, changenode, |
|
1746 | displayer.show(rev, changenode, copies=copies) | |
1760 | elif st == 'iter': |
|
1747 | elif st == 'iter': | |
1761 | if count == limit: break |
|
1748 | if count == limit: break | |
1762 | if displayer.flush(rev): |
|
1749 | if displayer.flush(rev): | |
@@ -1850,7 +1837,7 b' def outgoing(ui, repo, dest=None, **opts' | |||||
1850 | continue |
|
1837 | continue | |
1851 | displayer.show(changenode=n) |
|
1838 | displayer.show(changenode=n) | |
1852 |
|
1839 | |||
1853 |
def parents(ui, repo, file_=None, rev=None, |
|
1840 | def parents(ui, repo, file_=None, rev=None, **opts): | |
1854 | """show the parents of the working dir or revision |
|
1841 | """show the parents of the working dir or revision | |
1855 |
|
1842 | |||
1856 | Print the working directory's parent revisions. |
|
1843 | Print the working directory's parent revisions. | |
@@ -1875,15 +1862,10 b' def parents(ui, repo, file_=None, rev=No' | |||||
1875 | else: |
|
1862 | else: | |
1876 | p = repo.dirstate.parents() |
|
1863 | p = repo.dirstate.parents() | |
1877 |
|
1864 | |||
1878 | br = None |
|
|||
1879 | if branches is not None: |
|
|||
1880 | ui.warn(_("the --branches option is deprecated, " |
|
|||
1881 | "please use 'hg branches' instead\n")) |
|
|||
1882 | br = repo.branchlookup(p) |
|
|||
1883 | displayer = cmdutil.show_changeset(ui, repo, opts) |
|
1865 | displayer = cmdutil.show_changeset(ui, repo, opts) | |
1884 | for n in p: |
|
1866 | for n in p: | |
1885 | if n != nullid: |
|
1867 | if n != nullid: | |
1886 |
displayer.show(changenode=n |
|
1868 | displayer.show(changenode=n) | |
1887 |
|
1869 | |||
1888 | def paths(ui, repo, search=None): |
|
1870 | def paths(ui, repo, search=None): | |
1889 | """show definition of symbolic path names |
|
1871 | """show definition of symbolic path names | |
@@ -2501,13 +2483,7 b' def tip(ui, repo, **opts):' | |||||
2501 |
|
2483 | |||
2502 | Show the tip revision. |
|
2484 | Show the tip revision. | |
2503 | """ |
|
2485 | """ | |
2504 | n = repo.changelog.tip() |
|
2486 | cmdutil.show_changeset(ui, repo, opts).show(repo.changelog.count()-1) | |
2505 | br = None |
|
|||
2506 | if opts['branches']: |
|
|||
2507 | ui.warn(_("the --branches option is deprecated, " |
|
|||
2508 | "please use 'hg branches' instead\n")) |
|
|||
2509 | br = repo.branchlookup([n]) |
|
|||
2510 | cmdutil.show_changeset(ui, repo, opts).show(changenode=n, brinfo=br) |
|
|||
2511 |
|
2487 | |||
2512 | def unbundle(ui, repo, fname, **opts): |
|
2488 | def unbundle(ui, repo, fname, **opts): | |
2513 | """apply a changegroup file |
|
2489 | """apply a changegroup file | |
@@ -2574,8 +2550,7 b' def _lookup(repo, node, branch=None):' | |||||
2574 | if len(found) > 1: |
|
2550 | if len(found) > 1: | |
2575 | repo.ui.warn(_("Found multiple heads for %s\n") % branch) |
|
2551 | repo.ui.warn(_("Found multiple heads for %s\n") % branch) | |
2576 | for x in found: |
|
2552 | for x in found: | |
2577 | cmdutil.show_changeset(ui, repo, {}).show( |
|
2553 | cmdutil.show_changeset(ui, repo, {}).show(changenode=x) | |
2578 | changenode=x, brinfo=br) |
|
|||
2579 | raise util.Abort("") |
|
2554 | raise util.Abort("") | |
2580 | if len(found) == 1: |
|
2555 | if len(found) == 1: | |
2581 | node = found[0] |
|
2556 | node = found[0] |
General Comments 0
You need to be logged in to leave comments.
Login now