##// END OF EJS Templates
perf: support bdiffing multiple revisions in a single revlog...
Gregory Szorc -
r30336:7ddc8f8d default
parent child Browse files
Show More
@@ -747,9 +747,17 b' def perffncacheencode(ui, repo, **opts):'
747 timer(d)
747 timer(d)
748 fm.end()
748 fm.end()
749
749
750 @command('perfbdiff', revlogopts + formatteropts, '-c|-m|FILE REV')
750 @command('perfbdiff', revlogopts + formatteropts + [
751 def perfbdiff(ui, repo, file_, rev=None, **opts):
751 ('', 'count', 1, 'number of revisions to test (when using --startrev)')],
752 """benchmark a bdiff between a revision and its delta parent"""
752 '-c|-m|FILE REV')
753 def perfbdiff(ui, repo, file_, rev=None, count=None, **opts):
754 """benchmark a bdiff between revisions
755
756 By default, benchmark a bdiff between its delta parent and itself.
757
758 With ``--count``, benchmark bdiffs between delta parents and self for N
759 revisions starting at the specified revision.
760 """
753 if opts.get('changelog') or opts.get('manifest'):
761 if opts.get('changelog') or opts.get('manifest'):
754 file_, rev = None, file_
762 file_, rev = None, file_
755 elif rev is None:
763 elif rev is None:
@@ -759,10 +767,10 b' def perfbdiff(ui, repo, file_, rev=None,'
759
767
760 r = cmdutil.openrevlog(repo, 'perfbdiff', file_, opts)
768 r = cmdutil.openrevlog(repo, 'perfbdiff', file_, opts)
761
769
762 node = r.lookup(rev)
770 startrev = r.rev(r.lookup(rev))
763 rev = r.rev(node)
771 for rev in range(startrev, min(startrev + count, len(r) - 1)):
764 dp = r.deltaparent(rev)
772 dp = r.deltaparent(rev)
765 textpairs.append((r.revision(dp), r.revision(node)))
773 textpairs.append((r.revision(dp), r.revision(rev)))
766
774
767 def d():
775 def d():
768 for pair in textpairs:
776 for pair in textpairs:
@@ -50,7 +50,7 b' perfstatus'
50 perfancestorset
50 perfancestorset
51 (no help text available)
51 (no help text available)
52 perfannotate (no help text available)
52 perfannotate (no help text available)
53 perfbdiff benchmark a bdiff between a revision and its delta parent
53 perfbdiff benchmark a bdiff between revisions
54 perfbranchmap
54 perfbranchmap
55 benchmark the update of a branchmap
55 benchmark the update of a branchmap
56 perfcca (no help text available)
56 perfcca (no help text available)
General Comments 0
You need to be logged in to leave comments. Login now