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