Show More
@@ -708,15 +708,15 b' class changeset_printer(object):' | |||
|
708 | 708 | if self.footer: |
|
709 | 709 | self.ui.write(self.footer) |
|
710 | 710 | |
|
711 | def show(self, ctx, copies=None, **props): | |
|
711 | def show(self, ctx, copies=None, matchfn=None, **props): | |
|
712 | 712 | if self.buffered: |
|
713 | 713 | self.ui.pushbuffer() |
|
714 | self._show(ctx, copies, props) | |
|
714 | self._show(ctx, copies, matchfn, props) | |
|
715 | 715 | self.hunk[ctx.rev()] = self.ui.popbuffer(labeled=True) |
|
716 | 716 | else: |
|
717 | self._show(ctx, copies, props) | |
|
717 | self._show(ctx, copies, matchfn, props) | |
|
718 | 718 | |
|
719 | def _show(self, ctx, copies, props): | |
|
719 | def _show(self, ctx, copies, matchfn, props): | |
|
720 | 720 | '''show a single changeset or file revision''' |
|
721 | 721 | changenode = ctx.node() |
|
722 | 722 | rev = ctx.rev() |
@@ -796,15 +796,17 b' class changeset_printer(object):' | |||
|
796 | 796 | label='log.summary') |
|
797 | 797 | self.ui.write("\n") |
|
798 | 798 | |
|
799 | self.showpatch(changenode) | |
|
799 | self.showpatch(changenode, matchfn) | |
|
800 | 800 | |
|
801 | def showpatch(self, node): | |
|
802 |
if |
|
|
801 | def showpatch(self, node, matchfn): | |
|
802 | if not matchfn: | |
|
803 | matchfn = self.patch | |
|
804 | if matchfn: | |
|
803 | 805 | stat = self.diffopts.get('stat') |
|
804 | 806 | diffopts = patch.diffopts(self.ui, self.diffopts) |
|
805 | 807 | prev = self.repo.changelog.parents(node)[0] |
|
806 | 808 | diffordiffstat(self.ui, self.repo, diffopts, prev, node, |
|
807 |
match= |
|
|
809 | match=matchfn, stat=stat) | |
|
808 | 810 | self.ui.write("\n") |
|
809 | 811 | |
|
810 | 812 | def _meaningful_parentrevs(self, log, rev): |
@@ -857,7 +859,7 b' class changeset_templater(changeset_prin' | |||
|
857 | 859 | return [] |
|
858 | 860 | return parents |
|
859 | 861 | |
|
860 | def _show(self, ctx, copies, props): | |
|
862 | def _show(self, ctx, copies, matchfn, props): | |
|
861 | 863 | '''show a single changeset or file revision''' |
|
862 | 864 | |
|
863 | 865 | showlist = templatekw.showlist |
@@ -912,7 +914,7 b' class changeset_templater(changeset_prin' | |||
|
912 | 914 | # write changeset metadata, then patch if requested |
|
913 | 915 | key = types['changeset'] |
|
914 | 916 | self.ui.write(templater.stringify(self.t(key, **props))) |
|
915 | self.showpatch(ctx.node()) | |
|
917 | self.showpatch(ctx.node(), matchfn) | |
|
916 | 918 | |
|
917 | 919 | if types['footer']: |
|
918 | 920 | if not self.footer: |
@@ -925,7 +927,7 b' class changeset_templater(changeset_prin' | |||
|
925 | 927 | except SyntaxError, inst: |
|
926 | 928 | raise util.Abort('%s: %s' % (self.t.mapfile, inst.args[0])) |
|
927 | 929 | |
|
928 |
def show_changeset(ui, repo, opts, buffered=False |
|
|
930 | def show_changeset(ui, repo, opts, buffered=False): | |
|
929 | 931 | """show one changeset using template or regular display. |
|
930 | 932 | |
|
931 | 933 | Display format will be the first non-empty hit of: |
@@ -939,7 +941,7 b' def show_changeset(ui, repo, opts, buffe' | |||
|
939 | 941 | # options |
|
940 | 942 | patch = False |
|
941 | 943 | if opts.get('patch') or opts.get('stat'): |
|
942 |
patch = |
|
|
944 | patch = matchall(repo) | |
|
943 | 945 | |
|
944 | 946 | tmpl = opts.get('template') |
|
945 | 947 | style = None |
@@ -2484,7 +2484,7 b' def log(ui, repo, *pats, **opts):' | |||
|
2484 | 2484 | branches = opts.get('branch', []) + opts.get('only_branch', []) |
|
2485 | 2485 | opts['branch'] = [repo.lookupbranch(b) for b in branches] |
|
2486 | 2486 | |
|
2487 |
displayer = cmdutil.show_changeset(ui, repo, opts, True |
|
|
2487 | displayer = cmdutil.show_changeset(ui, repo, opts, True) | |
|
2488 | 2488 | def prep(ctx, fns): |
|
2489 | 2489 | rev = ctx.rev() |
|
2490 | 2490 | parents = [p for p in repo.changelog.parentrevs(rev) |
@@ -2517,7 +2517,11 b' def log(ui, repo, *pats, **opts):' | |||
|
2517 | 2517 | if rename: |
|
2518 | 2518 | copies.append((fn, rename[0])) |
|
2519 | 2519 | |
|
2520 | displayer.show(ctx, copies=copies) | |
|
2520 | revmatchfn = None | |
|
2521 | if opts.get('patch') or opts.get('stat'): | |
|
2522 | revmatchfn = cmdutil.match(repo, fns) | |
|
2523 | ||
|
2524 | displayer.show(ctx, copies=copies, matchfn=revmatchfn) | |
|
2521 | 2525 | |
|
2522 | 2526 | for ctx in cmdutil.walkchangerevs(repo, matchfn, opts, prep): |
|
2523 | 2527 | if count == limit: |
General Comments 0
You need to be logged in to leave comments.
Login now