comparison mercurial/commands.py @ 1395:c2eb204917f8

Add debugsetparents command
author Matt Mackall <mpm@selenic.com>
date Tue, 18 Oct 2005 00:43:33 -0700
parents ce95599eedac
children cf9a1233738a
comparison
equal deleted inserted replaced
1394:b20b683e8d95 1395:c2eb204917f8
833 repo = hg.repository(ui) 833 repo = hg.repository(ui)
834 except hg.RepoError: 834 except hg.RepoError:
835 pass 835 pass
836 for section, name, value in ui.walkconfig(): 836 for section, name, value in ui.walkconfig():
837 ui.write('%s.%s=%s\n' % (section, name, value)) 837 ui.write('%s.%s=%s\n' % (section, name, value))
838
839 def debugsetparents(ui, repo, rev1, rev2=None):
840 """
841 manually set the parents of the current working directory
842
843 This is useful for writing repository conversion tools, but should
844 be used with care.
845 """
846
847 if not rev2:
848 rev2 = hex(nullid)
849
850 repo.dirstate.setparents(repo.lookup(rev1), repo.lookup(rev2))
838 851
839 def debugstate(ui, repo): 852 def debugstate(ui, repo):
840 """show the contents of the current dirstate""" 853 """show the contents of the current dirstate"""
841 repo.dirstate.read() 854 repo.dirstate.read()
842 dc = repo.dirstate.map 855 dc = repo.dirstate.map
1809 ('p', 'parents', None, 'append source path to dest')], 1822 ('p', 'parents', None, 'append source path to dest')],
1810 'hg copy [OPTION]... [SOURCE]... DEST'), 1823 'hg copy [OPTION]... [SOURCE]... DEST'),
1811 "debugancestor": (debugancestor, [], 'debugancestor INDEX REV1 REV2'), 1824 "debugancestor": (debugancestor, [], 'debugancestor INDEX REV1 REV2'),
1812 "debugcheckstate": (debugcheckstate, [], 'debugcheckstate'), 1825 "debugcheckstate": (debugcheckstate, [], 'debugcheckstate'),
1813 "debugconfig": (debugconfig, [], 'debugconfig'), 1826 "debugconfig": (debugconfig, [], 'debugconfig'),
1827 "debugsetparents": (debugsetparents, [], 'debugsetparents REV1 [REV2]'),
1814 "debugstate": (debugstate, [], 'debugstate'), 1828 "debugstate": (debugstate, [], 'debugstate'),
1815 "debugdata": (debugdata, [], 'debugdata FILE REV'), 1829 "debugdata": (debugdata, [], 'debugdata FILE REV'),
1816 "debugindex": (debugindex, [], 'debugindex FILE'), 1830 "debugindex": (debugindex, [], 'debugindex FILE'),
1817 "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'), 1831 "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'),
1818 "debugrename": (debugrename, [], 'debugrename FILE [REV]'), 1832 "debugrename": (debugrename, [], 'debugrename FILE [REV]'),