##// END OF EJS Templates
debugcommands: move 'debugrebuilddirstate' in the new module
Pierre-Yves David -
r30948:cc2b537b default
parent child Browse files
Show More
@@ -1859,44 +1859,6 b' def copy(ui, repo, *pats, **opts):'
1859 with repo.wlock(False):
1859 with repo.wlock(False):
1860 return cmdutil.copy(ui, repo, pats, opts)
1860 return cmdutil.copy(ui, repo, pats, opts)
1861
1861
1862 @command('debugrebuilddirstate|debugrebuildstate',
1863 [('r', 'rev', '', _('revision to rebuild to'), _('REV')),
1864 ('', 'minimal', None, _('only rebuild files that are inconsistent with '
1865 'the working copy parent')),
1866 ],
1867 _('[-r REV]'))
1868 def debugrebuilddirstate(ui, repo, rev, **opts):
1869 """rebuild the dirstate as it would look like for the given revision
1870
1871 If no revision is specified the first current parent will be used.
1872
1873 The dirstate will be set to the files of the given revision.
1874 The actual working directory content or existing dirstate
1875 information such as adds or removes is not considered.
1876
1877 ``minimal`` will only rebuild the dirstate status for files that claim to be
1878 tracked but are not in the parent manifest, or that exist in the parent
1879 manifest but are not in the dirstate. It will not change adds, removes, or
1880 modified files that are in the working copy parent.
1881
1882 One use of this command is to make the next :hg:`status` invocation
1883 check the actual file content.
1884 """
1885 ctx = scmutil.revsingle(repo, rev)
1886 with repo.wlock():
1887 dirstate = repo.dirstate
1888 changedfiles = None
1889 # See command doc for what minimal does.
1890 if opts.get('minimal'):
1891 manifestfiles = set(ctx.manifest().keys())
1892 dirstatefiles = set(dirstate)
1893 manifestonly = manifestfiles - dirstatefiles
1894 dsonly = dirstatefiles - manifestfiles
1895 dsnotadded = set(f for f in dsonly if dirstate[f] != 'a')
1896 changedfiles = manifestonly | dsnotadded
1897
1898 dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
1899
1900 @command('debugrebuildfncache', [], '')
1862 @command('debugrebuildfncache', [], '')
1901 def debugrebuildfncache(ui, repo):
1863 def debugrebuildfncache(ui, repo):
1902 """rebuild the fncache file"""
1864 """rebuild the fncache file"""
@@ -1457,6 +1457,44 b' def debugpvec(ui, repo, a, b=None):'
1457 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec),
1457 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec),
1458 pa.distance(pb), rel))
1458 pa.distance(pb), rel))
1459
1459
1460 @command('debugrebuilddirstate|debugrebuildstate',
1461 [('r', 'rev', '', _('revision to rebuild to'), _('REV')),
1462 ('', 'minimal', None, _('only rebuild files that are inconsistent with '
1463 'the working copy parent')),
1464 ],
1465 _('[-r REV]'))
1466 def debugrebuilddirstate(ui, repo, rev, **opts):
1467 """rebuild the dirstate as it would look like for the given revision
1468
1469 If no revision is specified the first current parent will be used.
1470
1471 The dirstate will be set to the files of the given revision.
1472 The actual working directory content or existing dirstate
1473 information such as adds or removes is not considered.
1474
1475 ``minimal`` will only rebuild the dirstate status for files that claim to be
1476 tracked but are not in the parent manifest, or that exist in the parent
1477 manifest but are not in the dirstate. It will not change adds, removes, or
1478 modified files that are in the working copy parent.
1479
1480 One use of this command is to make the next :hg:`status` invocation
1481 check the actual file content.
1482 """
1483 ctx = scmutil.revsingle(repo, rev)
1484 with repo.wlock():
1485 dirstate = repo.dirstate
1486 changedfiles = None
1487 # See command doc for what minimal does.
1488 if opts.get('minimal'):
1489 manifestfiles = set(ctx.manifest().keys())
1490 dirstatefiles = set(dirstate)
1491 manifestonly = manifestfiles - dirstatefiles
1492 dsonly = dirstatefiles - manifestfiles
1493 dsnotadded = set(f for f in dsonly if dirstate[f] != 'a')
1494 changedfiles = manifestonly | dsnotadded
1495
1496 dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
1497
1460 @command('debugupgraderepo', [
1498 @command('debugupgraderepo', [
1461 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
1499 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
1462 ('', 'run', False, _('performs an upgrade')),
1500 ('', 'run', False, _('performs an upgrade')),
General Comments 0
You need to be logged in to leave comments. Login now