comparison mercurial/merge.py @ 2894:f28f4c850cd8

merge: hoist some working manifest logic out of merge loop
author Matt Mackall <mpm@selenic.com>
date Tue, 15 Aug 2006 16:27:19 -0500
parents 3cef09d12010
children 834e147842d7
comparison
equal deleted inserted replaced
2893:3cef09d12010 2894:f28f4c850cd8
114 # construct a working dir manifest 114 # construct a working dir manifest
115 mw = m1.copy() 115 mw = m1.copy()
116 umap = dict.fromkeys(unknown) 116 umap = dict.fromkeys(unknown)
117 117
118 for f in added + modified + unknown: 118 for f in added + modified + unknown:
119 mw[f] = None 119 mw[f] = ""
120 if f in m1: mw[f] = "" # distinguish between changed and new 120 # is the wfile new and matches m2?
121 if (f not in m1 and f in m2 and
122 not repo.file(f).cmp(m2[f], repo.wread(f))):
123 mw[f] = m2[f]
124
121 mw.set(f, util.is_exec(repo.wjoin(f), mw.execf(f))) 125 mw.set(f, util.is_exec(repo.wjoin(f), mw.execf(f)))
122 126
123 for f in deleted + removed: 127 for f in deleted + removed:
124 if f in mw: 128 if f in mw:
125 del mw[f] 129 del mw[f]
136 for f, n in mw.iteritems(): 140 for f, n in mw.iteritems():
137 if partial and not partial(f): 141 if partial and not partial(f):
138 continue 142 continue
139 if f in m2: 143 if f in m2:
140 s = 0 144 s = 0
141
142 # is the wfile new and matches m2?
143 if mw[f] == None:
144 if not repo.file(f).cmp(m2[f], repo.wread(f)):
145 n = m2[f]
146 145
147 # are files different? 146 # are files different?
148 if n != m2[f]: 147 if n != m2[f]:
149 a = ma.get(f, nullid) 148 a = ma.get(f, nullid)
150 # are both different from the ancestor? 149 # are both different from the ancestor?