##// END OF EJS Templates
debugcommands: move 'debugpvec' in the new module
Pierre-Yves David -
r30947:3c766ca8 default
parent child Browse files
Show More
@@ -46,7 +46,6 b' from . import ('
46 obsolete,
46 obsolete,
47 patch,
47 patch,
48 phases,
48 phases,
49 pvec,
50 pycompat,
49 pycompat,
51 repair,
50 repair,
52 revlog,
51 revlog,
@@ -1860,27 +1859,6 b' def copy(ui, repo, *pats, **opts):'
1860 with repo.wlock(False):
1859 with repo.wlock(False):
1861 return cmdutil.copy(ui, repo, pats, opts)
1860 return cmdutil.copy(ui, repo, pats, opts)
1862
1861
1863 @command('debugpvec', [], _('A B'))
1864 def debugpvec(ui, repo, a, b=None):
1865 ca = scmutil.revsingle(repo, a)
1866 cb = scmutil.revsingle(repo, b)
1867 pa = pvec.ctxpvec(ca)
1868 pb = pvec.ctxpvec(cb)
1869 if pa == pb:
1870 rel = "="
1871 elif pa > pb:
1872 rel = ">"
1873 elif pa < pb:
1874 rel = "<"
1875 elif pa | pb:
1876 rel = "|"
1877 ui.write(_("a: %s\n") % pa)
1878 ui.write(_("b: %s\n") % pb)
1879 ui.write(_("depth(a): %d depth(b): %d\n") % (pa._depth, pb._depth))
1880 ui.write(_("delta: %d hdist: %d distance: %d relation: %s\n") %
1881 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec),
1882 pa.distance(pb), rel))
1883
1884 @command('debugrebuilddirstate|debugrebuildstate',
1862 @command('debugrebuilddirstate|debugrebuildstate',
1885 [('r', 'rev', '', _('revision to rebuild to'), _('REV')),
1863 [('r', 'rev', '', _('revision to rebuild to'), _('REV')),
1886 ('', 'minimal', None, _('only rebuild files that are inconsistent with '
1864 ('', 'minimal', None, _('only rebuild files that are inconsistent with '
@@ -43,6 +43,7 b' from . import ('
43 merge as mergemod,
43 merge as mergemod,
44 obsolete,
44 obsolete,
45 policy,
45 policy,
46 pvec,
46 pycompat,
47 pycompat,
47 repair,
48 repair,
48 revlog,
49 revlog,
@@ -1435,6 +1436,27 b' def debugpushkey(ui, repopath, namespace'
1435 ui.write("%s\t%s\n" % (k.encode('string-escape'),
1436 ui.write("%s\t%s\n" % (k.encode('string-escape'),
1436 v.encode('string-escape')))
1437 v.encode('string-escape')))
1437
1438
1439 @command('debugpvec', [], _('A B'))
1440 def debugpvec(ui, repo, a, b=None):
1441 ca = scmutil.revsingle(repo, a)
1442 cb = scmutil.revsingle(repo, b)
1443 pa = pvec.ctxpvec(ca)
1444 pb = pvec.ctxpvec(cb)
1445 if pa == pb:
1446 rel = "="
1447 elif pa > pb:
1448 rel = ">"
1449 elif pa < pb:
1450 rel = "<"
1451 elif pa | pb:
1452 rel = "|"
1453 ui.write(_("a: %s\n") % pa)
1454 ui.write(_("b: %s\n") % pb)
1455 ui.write(_("depth(a): %d depth(b): %d\n") % (pa._depth, pb._depth))
1456 ui.write(_("delta: %d hdist: %d distance: %d relation: %s\n") %
1457 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec),
1458 pa.distance(pb), rel))
1459
1438 @command('debugupgraderepo', [
1460 @command('debugupgraderepo', [
1439 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
1461 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
1440 ('', 'run', False, _('performs an upgrade')),
1462 ('', 'run', False, _('performs an upgrade')),
General Comments 0
You need to be logged in to leave comments. Login now