##// END OF EJS Templates
subrepo: add more debugging output, lose _ markers
Matt Mackall -
r9782:c1c40511 default
parent child Browse files
Show More
@@ -52,10 +52,12 b' def submerge(repo, wctx, mctx, actx):'
52 52 sa = actx.substate
53 53 sm = {}
54 54
55 repo.ui.debug("subrepo merge %s %s %s\n" % (wctx, mctx, actx))
56
55 57 def debug(s, msg, r=""):
56 58 if r:
57 59 r = "%s:%s" % r
58 repo.ui.debug(_(" subrepo %s: %s %s\n") % (s, msg, r))
60 repo.ui.debug(" subrepo %s: %s %s\n" % (s, msg, r))
59 61
60 62 for s, l in s1.items():
61 63 if wctx.sub(s).dirty():
@@ -67,7 +69,7 b' def submerge(repo, wctx, mctx, actx):'
67 69 sm[s] = l
68 70 continue
69 71 elif l == a: # other side changed
70 debug(s, _("other changed, get"), r)
72 debug(s, "other changed, get", r)
71 73 wctx.sub(s).get(r)
72 74 sm[s] = r
73 75 elif l[0] != r[0]: # sources differ
@@ -76,33 +78,33 b' def submerge(repo, wctx, mctx, actx):'
76 78 'use (l)ocal source (%s) or (r)emote source (%s)?')
77 79 % (s, l[0], r[0]),
78 80 (_('&Local'), _('&Remote')), 0):
79 debug(s, _("prompt changed, get"), r)
81 debug(s, "prompt changed, get", r)
80 82 wctx.sub(s).get(r)
81 83 sm[s] = r
82 84 elif l[1] == a[1]: # local side is unchanged
83 debug(s, _("other side changed, get"), r)
85 debug(s, "other side changed, get", r)
84 86 wctx.sub(s).get(r)
85 87 sm[s] = r
86 88 else:
87 debug(s, _("both sides changed, merge with"), r)
89 debug(s, "both sides changed, merge with", r)
88 90 wctx.sub(s).merge(r)
89 91 sm[s] = l
90 92 elif l == a: # remote removed, local unchanged
91 debug(s, _("remote removed, remove"))
93 debug(s, "remote removed, remove")
92 94 wctx.sub(s).remove()
93 95 else:
94 96 if repo.ui.promptchoice(
95 97 _(' local changed subrepository %s which remote removed\n'
96 98 'use (c)hanged version or (d)elete?') % s,
97 99 (_('&Changed'), _('&Delete')), 0):
98 debug(s, _("prompt remove"))
100 debug(s, "prompt remove")
99 101 wctx.sub(s).remove()
100 102
101 103 for s, r in s2.items():
102 104 if s in s1:
103 105 continue
104 106 elif s not in sa:
105 debug(s, _("remote added, get"), r)
107 debug(s, "remote added, get", r)
106 108 wctx.sub(s).get(r)
107 109 sm[s] = r
108 110 elif r != sa[s]:
@@ -110,7 +112,7 b' def submerge(repo, wctx, mctx, actx):'
110 112 _(' remote changed subrepository %s which local removed\n'
111 113 'use (c)hanged version or (d)elete?') % s,
112 114 (_('&Changed'), _('&Delete')), 0) == 0:
113 debug(s, _("prompt recreate"), r)
115 debug(s, "prompt recreate", r)
114 116 wctx.sub(s).get(r)
115 117 sm[s] = r
116 118
@@ -171,6 +173,7 b' class hgsubrepo(object):'
171 173 return w.dirty() # working directory changed
172 174
173 175 def commit(self, text, user, date):
176 self._repo.ui.debug("committing subrepo %s\n" % self._path)
174 177 n = self._repo.commit(text, user, date)
175 178 if not n:
176 179 return self._repo['.'].hex() # different version checked out
@@ -196,6 +199,7 b' class hgsubrepo(object):'
196 199 def get(self, state):
197 200 self._get(state)
198 201 source, revision = state
202 self._repo.ui.debug("getting subrepo %s\n" % self._path)
199 203 hg.clean(self._repo, revision, False)
200 204
201 205 def merge(self, state):
@@ -203,8 +207,10 b' class hgsubrepo(object):'
203 207 cur = self._repo['.']
204 208 dst = self._repo[state[1]]
205 209 if dst.ancestor(cur) == cur:
210 self._repo.ui.debug("updating subrepo %s\n" % self._path)
206 211 hg.update(self._repo, state[1])
207 212 else:
213 self._repo.ui.debug("merging subrepo %s\n" % self._path)
208 214 hg.merge(self._repo, state[1], remind=False)
209 215
210 216 def push(self, force):
General Comments 0
You need to be logged in to leave comments. Login now