# HG changeset patch # User Pierre-Yves David # Date 1486026242 -3600 # Node ID 5b09e9bc0902c06f5f33140204868a47280b37d0 # Parent 85c3c879c43acc89f2c22b6ee3f3de0476114f8a debugcommands: move 'debugsetparents' in the new module diff -r 85c3c879c43a -r 5b09e9bc0902 mercurial/commands.py --- a/mercurial/commands.py Thu Feb 02 10:03:31 2017 +0100 +++ b/mercurial/commands.py Thu Feb 02 10:04:02 2017 +0100 @@ -1855,24 +1855,6 @@ with repo.wlock(False): return cmdutil.copy(ui, repo, pats, opts) -@command('debugsetparents', [], _('REV1 [REV2]')) -def debugsetparents(ui, repo, rev1, rev2=None): - """manually set the parents of the current working directory - - This is useful for writing repository conversion tools, but should - be used with care. For example, neither the working directory nor the - dirstate is updated, so file status may be incorrect after running this - command. - - Returns 0 on success. - """ - - r1 = scmutil.revsingle(repo, rev1).node() - r2 = scmutil.revsingle(repo, rev2, 'null').node() - - with repo.wlock(): - repo.setparents(r1, r2) - @command('debugdirstate|debugstate', [('', 'nodates', None, _('do not display the saved mtime')), ('', 'datesort', None, _('sort by saved mtime'))], diff -r 85c3c879c43a -r 5b09e9bc0902 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Thu Feb 02 10:03:31 2017 +0100 +++ b/mercurial/debugcommands.py Thu Feb 02 10:04:02 2017 +0100 @@ -1835,6 +1835,24 @@ for c in revs: ui.write("%s\n" % c) +@command('debugsetparents', [], _('REV1 [REV2]')) +def debugsetparents(ui, repo, rev1, rev2=None): + """manually set the parents of the current working directory + + This is useful for writing repository conversion tools, but should + be used with care. For example, neither the working directory nor the + dirstate is updated, so file status may be incorrect after running this + command. + + Returns 0 on success. + """ + + r1 = scmutil.revsingle(repo, rev1).node() + r2 = scmutil.revsingle(repo, rev2, 'null').node() + + with repo.wlock(): + repo.setparents(r1, r2) + @command('debugupgraderepo', [ ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), ('', 'run', False, _('performs an upgrade')),