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