##// 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 from . import (
46 46 obsolete,
47 47 patch,
48 48 phases,
49 pvec,
50 49 pycompat,
51 50 repair,
52 51 revlog,
@@ -1860,27 +1859,6 def copy(ui, repo, *pats, **opts):
1860 1859 with repo.wlock(False):
1861 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 1862 @command('debugrebuilddirstate|debugrebuildstate',
1885 1863 [('r', 'rev', '', _('revision to rebuild to'), _('REV')),
1886 1864 ('', 'minimal', None, _('only rebuild files that are inconsistent with '
@@ -43,6 +43,7 from . import (
43 43 merge as mergemod,
44 44 obsolete,
45 45 policy,
46 pvec,
46 47 pycompat,
47 48 repair,
48 49 revlog,
@@ -1435,6 +1436,27 def debugpushkey(ui, repopath, namespace
1435 1436 ui.write("%s\t%s\n" % (k.encode('string-escape'),
1436 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 1460 @command('debugupgraderepo', [
1439 1461 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
1440 1462 ('', 'run', False, _('performs an upgrade')),
General Comments 0
You need to be logged in to leave comments. Login now