##// END OF EJS Templates
subrepo: add some debug output to submerge
Matt Mackall -
r9779:58a6f3f4 default
parent child Browse files
Show More
@@ -52,6 +52,11 b' def submerge(repo, wctx, mctx, actx):'
52 52 sa = actx.substate
53 53 sm = {}
54 54
55 def debug(s, msg, r=""):
56 if r:
57 r = "%s:%s" % r
58 repo.ui.debug(_(" subrepo %s: %s %s\n") % (s, msg, r))
59
55 60 for s, l in s1.items():
56 61 a = sa.get(s, nullstate)
57 62 if s in s2:
@@ -60,6 +65,7 b' def submerge(repo, wctx, mctx, actx):'
60 65 sm[s] = l
61 66 continue
62 67 elif l == a: # other side changed
68 debug(s, _("other changed, get"), r)
63 69 wctx.sub(s).get(r)
64 70 sm[s] = r
65 71 elif l[0] != r[0]: # sources differ
@@ -68,27 +74,33 b' def submerge(repo, wctx, mctx, actx):'
68 74 'use (l)ocal source (%s) or (r)emote source (%s)?')
69 75 % (s, l[0], r[0]),
70 76 (_('&Local'), _('&Remote')), 0):
77 debug(s, _("prompt changed, get"), r)
71 78 wctx.sub(s).get(r)
72 79 sm[s] = r
73 80 elif l[1] == a[1]: # local side is unchanged
81 debug(s, _("other side changed, get"), r)
74 82 wctx.sub(s).get(r)
75 83 sm[s] = r
76 84 else:
85 debug(s, _("both sides changed, merge with"), r)
77 86 wctx.sub(s).merge(r)
78 87 sm[s] = l
79 88 elif l == a: # remote removed, local unchanged
89 debug(s, _("remote removed, remove"))
80 90 wctx.sub(s).remove()
81 91 else:
82 92 if repo.ui.promptchoice(
83 93 _(' local changed subrepository %s which remote removed\n'
84 94 'use (c)hanged version or (d)elete?') % s,
85 95 (_('&Changed'), _('&Delete')), 0):
96 debug(s, _("prompt remove"))
86 97 wctx.sub(s).remove()
87 98
88 99 for s, r in s2.items():
89 100 if s in s1:
90 101 continue
91 102 elif s not in sa:
103 debug(s, _("remote added, get"), r)
92 104 wctx.sub(s).get(r)
93 105 sm[s] = r
94 106 elif r != sa[s]:
@@ -96,6 +108,7 b' def submerge(repo, wctx, mctx, actx):'
96 108 _(' remote changed subrepository %s which local removed\n'
97 109 'use (c)hanged version or (d)elete?') % s,
98 110 (_('&Changed'), _('&Delete')), 0) == 0:
111 debug(s, _("prompt recreate"), r)
99 112 wctx.sub(s).get(r)
100 113 sm[s] = r
101 114
@@ -198,4 +211,3 b' class hgsubrepo(object):'
198 211 dsturl = _abssource(self._repo, True)
199 212 other = hg.repository(self._repo.ui, dsturl)
200 213 self._repo.push(other, force)
201
General Comments 0
You need to be logged in to leave comments. Login now