##// END OF EJS Templates
commands.py: use contexts in various places (debug*state, revert)
Benoit Boissinot -
r3972:356e20d4 default
parent child Browse files
Show More
@@ -684,15 +684,12 b" def debugcomplete(ui, cmd='', **opts):"
684 684 clist.sort()
685 685 ui.write("%s\n" % "\n".join(clist))
686 686
687 def debugrebuildstate(ui, repo, rev=None):
687 def debugrebuildstate(ui, repo, rev=""):
688 688 """rebuild the dirstate as it would look like for the given revision"""
689 if not rev:
689 if rev == "":
690 690 rev = repo.changelog.tip()
691 else:
692 rev = repo.lookup(rev)
693 change = repo.changelog.read(rev)
694 n = change[0]
695 files = repo.manifest.read(n)
691 ctx = repo.changectx(rev)
692 files = ctx.manifest()
696 693 wlock = repo.wlock()
697 694 repo.dirstate.rebuild(rev, files)
698 695
@@ -703,10 +700,8 b' def debugcheckstate(ui, repo):'
703 700 dc = repo.dirstate.map
704 701 keys = dc.keys()
705 702 keys.sort()
706 m1n = repo.changelog.read(parent1)[0]
707 m2n = repo.changelog.read(parent2)[0]
708 m1 = repo.manifest.read(m1n)
709 m2 = repo.manifest.read(m2n)
703 m1 = repo.changectx(parent1).manifest()
704 m2 = repo.changectx(parent2).manifest()
710 705 errors = 0
711 706 for f in dc:
712 707 state = repo.dirstate.state(f)
@@ -2127,8 +2122,9 b' def revert(ui, repo, *pats, **opts):'
2127 2122 if not opts['rev'] and p2 != nullid:
2128 2123 raise util.Abort(_('uncommitted merge - please provide a '
2129 2124 'specific revision'))
2130 node = repo.changectx(opts['rev']).node()
2131 mf = repo.manifest.read(repo.changelog.read(node)[0])
2125 ctx = repo.changectx(opts['rev'])
2126 node = ctx.node()
2127 mf = ctx.manifest()
2132 2128 if node == parent:
2133 2129 pmf = mf
2134 2130 else:
@@ -2218,7 +2214,7 b' def revert(ui, repo, *pats, **opts):'
2218 2214 if pmf is None:
2219 2215 # only need parent manifest in this unlikely case,
2220 2216 # so do not read by default
2221 pmf = repo.manifest.read(repo.changelog.read(parent)[0])
2217 pmf = repo.changectx(parent).manifest()
2222 2218 if abs in pmf:
2223 2219 if mfentry:
2224 2220 # if version of file is same in parent and target
General Comments 0
You need to be logged in to leave comments. Login now