comparison mercurial/merge.py @ 4117:c95060a5391a

merge: fix renaming of subdirectories under renamed directories
author Matt Mackall <mpm@selenic.com>
date Tue, 27 Feb 2007 16:20:06 -0600
parents c0a12e6441a5
children bb70d5fa02ae 7e1c8a565a4f
comparison
equal deleted inserted replaced
4106:f5f171785e29 4117:c95060a5391a
182 invalid[dsrc] = True 182 invalid[dsrc] = True
183 elif dsrc in dirmove and dirmove[dsrc] != ddst: 183 elif dsrc in dirmove and dirmove[dsrc] != ddst:
184 invalid[dsrc] = True 184 invalid[dsrc] = True
185 del dirmove[dsrc] 185 del dirmove[dsrc]
186 else: 186 else:
187 dirmove[dsrc] = ddst 187 dirmove[dsrc + "/"] = ddst + "/"
188 188
189 del d1, d2, invalid 189 del d1, d2, invalid
190 190
191 if not dirmove: 191 if not dirmove:
192 return copy 192 return copy
193 193
194 # check unaccounted nonoverlapping files 194 # check unaccounted nonoverlapping files
195 for f in u1 + u2: 195 for f in u1 + u2:
196 if f not in fullcopy: 196 if f not in fullcopy:
197 d = os.path.dirname(f) 197 for d in dirmove:
198 if d in dirmove: 198 if f.startswith(d):
199 copy[f] = dirmove[d] + "/" + os.path.basename(f) 199 copy[f] = dirmove[d] + f[len(d):]
200 break
200 201
201 return copy 202 return copy
202 203
203 def manifestmerge(repo, p1, p2, pa, overwrite, partial): 204 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
204 """ 205 """