Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 30953:5b09e9bc0902
debugcommands: move 'debugsetparents' in the new module
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 02 Feb 2017 10:04:02 +0100 |
parents | 85c3c879c43a |
children | dad968920130 |
comparison
equal
deleted
inserted
replaced
30952:85c3c879c43a | 30953:5b09e9bc0902 |
---|---|
1853 Returns 0 on success, 1 if errors are encountered. | 1853 Returns 0 on success, 1 if errors are encountered. |
1854 """ | 1854 """ |
1855 with repo.wlock(False): | 1855 with repo.wlock(False): |
1856 return cmdutil.copy(ui, repo, pats, opts) | 1856 return cmdutil.copy(ui, repo, pats, opts) |
1857 | 1857 |
1858 @command('debugsetparents', [], _('REV1 [REV2]')) | |
1859 def debugsetparents(ui, repo, rev1, rev2=None): | |
1860 """manually set the parents of the current working directory | |
1861 | |
1862 This is useful for writing repository conversion tools, but should | |
1863 be used with care. For example, neither the working directory nor the | |
1864 dirstate is updated, so file status may be incorrect after running this | |
1865 command. | |
1866 | |
1867 Returns 0 on success. | |
1868 """ | |
1869 | |
1870 r1 = scmutil.revsingle(repo, rev1).node() | |
1871 r2 = scmutil.revsingle(repo, rev2, 'null').node() | |
1872 | |
1873 with repo.wlock(): | |
1874 repo.setparents(r1, r2) | |
1875 | |
1876 @command('debugdirstate|debugstate', | 1858 @command('debugdirstate|debugstate', |
1877 [('', 'nodates', None, _('do not display the saved mtime')), | 1859 [('', 'nodates', None, _('do not display the saved mtime')), |
1878 ('', 'datesort', None, _('sort by saved mtime'))], | 1860 ('', 'datesort', None, _('sort by saved mtime'))], |
1879 _('[OPTION]...')) | 1861 _('[OPTION]...')) |
1880 def debugstate(ui, repo, **opts): | 1862 def debugstate(ui, repo, **opts): |