comparison mercurial/subrepo.py @ 31557:f97e90fa5ad7

merge with stable
author Augie Fackler <augie@google.com>
date Tue, 21 Mar 2017 18:36:14 -0400
parents 53865692a354 2915cc1d3429
children 2406dbba49bd
comparison
equal deleted inserted replaced
31556:66c3ae6d886c 31557:f97e90fa5ad7
193 def debug(s, msg, r=""): 193 def debug(s, msg, r=""):
194 if r: 194 if r:
195 r = "%s:%s:%s" % r 195 r = "%s:%s:%s" % r
196 repo.ui.debug(" subrepo %s: %s %s\n" % (s, msg, r)) 196 repo.ui.debug(" subrepo %s: %s %s\n" % (s, msg, r))
197 197
198 promptssrc = filemerge.partextras(labels)
198 for s, l in sorted(s1.iteritems()): 199 for s, l in sorted(s1.iteritems()):
200 prompts = None
199 a = sa.get(s, nullstate) 201 a = sa.get(s, nullstate)
200 ld = l # local state with possible dirty flag for compares 202 ld = l # local state with possible dirty flag for compares
201 if wctx.sub(s).dirty(): 203 if wctx.sub(s).dirty():
202 ld = (l[0], l[1] + "+") 204 ld = (l[0], l[1] + "+")
203 if wctx == actx: # overwrite 205 if wctx == actx: # overwrite
204 a = ld 206 a = ld
205 207
208 prompts = promptssrc.copy()
209 prompts['s'] = s
206 if s in s2: 210 if s in s2:
207 prompts = filemerge.partextras(labels)
208 prompts['s'] = s
209 r = s2[s] 211 r = s2[s]
210 if ld == r or r == a: # no change or local is newer 212 if ld == r or r == a: # no change or local is newer
211 sm[s] = l 213 sm[s] = l
212 continue 214 continue
213 elif ld == a: # other side changed 215 elif ld == a: # other side changed
266 '$$ &Changed $$ &Delete') % prompts, 0): 268 '$$ &Changed $$ &Delete') % prompts, 0):
267 debug(s, "prompt remove") 269 debug(s, "prompt remove")
268 wctx.sub(s).remove() 270 wctx.sub(s).remove()
269 271
270 for s, r in sorted(s2.items()): 272 for s, r in sorted(s2.items()):
273 prompts = None
271 if s in s1: 274 if s in s1:
272 continue 275 continue
273 elif s not in sa: 276 elif s not in sa:
274 debug(s, "remote added, get", r) 277 debug(s, "remote added, get", r)
275 mctx.sub(s).get(r) 278 mctx.sub(s).get(r)
276 sm[s] = r 279 sm[s] = r
277 elif r != sa[s]: 280 elif r != sa[s]:
281 prompts = promptssrc.copy()
282 prompts['s'] = s
278 if repo.ui.promptchoice( 283 if repo.ui.promptchoice(
279 _(' remote%(o)s changed subrepository %(s)s' 284 _(' remote%(o)s changed subrepository %(s)s'
280 ' which local%(l)s removed\n' 285 ' which local%(l)s removed\n'
281 'use (c)hanged version or (d)elete?' 286 'use (c)hanged version or (d)elete?'
282 '$$ &Changed $$ &Delete') % prompts, 0) == 0: 287 '$$ &Changed $$ &Delete') % prompts, 0) == 0: