--- a/mercurial/subrepo.py Sat Nov 07 16:31:43 2009 -0600
+++ b/mercurial/subrepo.py Sun Nov 08 10:24:18 2009 -0600
@@ -52,10 +52,12 @@
sa = actx.substate
sm = {}
+ repo.ui.debug("subrepo merge %s %s %s\n" % (wctx, mctx, actx))
+
def debug(s, msg, r=""):
if r:
r = "%s:%s" % r
- repo.ui.debug(_(" subrepo %s: %s %s\n") % (s, msg, r))
+ repo.ui.debug(" subrepo %s: %s %s\n" % (s, msg, r))
for s, l in s1.items():
if wctx.sub(s).dirty():
@@ -67,7 +69,7 @@
sm[s] = l
continue
elif l == a: # other side changed
- debug(s, _("other changed, get"), r)
+ debug(s, "other changed, get", r)
wctx.sub(s).get(r)
sm[s] = r
elif l[0] != r[0]: # sources differ
@@ -76,33 +78,33 @@
'use (l)ocal source (%s) or (r)emote source (%s)?')
% (s, l[0], r[0]),
(_('&Local'), _('&Remote')), 0):
- debug(s, _("prompt changed, get"), r)
+ debug(s, "prompt changed, get", r)
wctx.sub(s).get(r)
sm[s] = r
elif l[1] == a[1]: # local side is unchanged
- debug(s, _("other side changed, get"), r)
+ debug(s, "other side changed, get", r)
wctx.sub(s).get(r)
sm[s] = r
else:
- debug(s, _("both sides changed, merge with"), r)
+ debug(s, "both sides changed, merge with", r)
wctx.sub(s).merge(r)
sm[s] = l
elif l == a: # remote removed, local unchanged
- debug(s, _("remote removed, remove"))
+ debug(s, "remote removed, remove")
wctx.sub(s).remove()
else:
if repo.ui.promptchoice(
_(' local changed subrepository %s which remote removed\n'
'use (c)hanged version or (d)elete?') % s,
(_('&Changed'), _('&Delete')), 0):
- debug(s, _("prompt remove"))
+ debug(s, "prompt remove")
wctx.sub(s).remove()
for s, r in s2.items():
if s in s1:
continue
elif s not in sa:
- debug(s, _("remote added, get"), r)
+ debug(s, "remote added, get", r)
wctx.sub(s).get(r)
sm[s] = r
elif r != sa[s]:
@@ -110,7 +112,7 @@
_(' remote changed subrepository %s which local removed\n'
'use (c)hanged version or (d)elete?') % s,
(_('&Changed'), _('&Delete')), 0) == 0:
- debug(s, _("prompt recreate"), r)
+ debug(s, "prompt recreate", r)
wctx.sub(s).get(r)
sm[s] = r
@@ -171,6 +173,7 @@
return w.dirty() # working directory changed
def commit(self, text, user, date):
+ self._repo.ui.debug("committing subrepo %s\n" % self._path)
n = self._repo.commit(text, user, date)
if not n:
return self._repo['.'].hex() # different version checked out
@@ -196,6 +199,7 @@
def get(self, state):
self._get(state)
source, revision = state
+ self._repo.ui.debug("getting subrepo %s\n" % self._path)
hg.clean(self._repo, revision, False)
def merge(self, state):
@@ -203,8 +207,10 @@
cur = self._repo['.']
dst = self._repo[state[1]]
if dst.ancestor(cur) == cur:
+ self._repo.ui.debug("updating subrepo %s\n" % self._path)
hg.update(self._repo, state[1])
else:
+ self._repo.ui.debug("merging subrepo %s\n" % self._path)
hg.merge(self._repo, state[1], remind=False)
def push(self, force):