Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 2893:3cef09d12010
merge: working manifest new/changed
To remove dependence on m1 during manifest comparison, we distinguish between
new and changed states in mw.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 15 Aug 2006 16:12:51 -0500 |
parents | dd41ad984f71 |
children | f28f4c850cd8 |
comparison
equal
deleted
inserted
replaced
2892:dd41ad984f71 | 2893:3cef09d12010 |
---|---|
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] = "" | 119 mw[f] = None |
120 if f in m1: mw[f] = "" # distinguish between changed and new | |
120 mw.set(f, util.is_exec(repo.wjoin(f), mw.execf(f))) | 121 mw.set(f, util.is_exec(repo.wjoin(f), mw.execf(f))) |
121 | 122 |
122 for f in deleted + removed: | 123 for f in deleted + removed: |
123 if f in mw: | 124 if f in mw: |
124 del mw[f] | 125 del mw[f] |
136 if partial and not partial(f): | 137 if partial and not partial(f): |
137 continue | 138 continue |
138 if f in m2: | 139 if f in m2: |
139 s = 0 | 140 s = 0 |
140 | 141 |
141 # is the wfile new since m1, and match m2? | 142 # is the wfile new and matches m2? |
142 if f not in m1: | 143 if mw[f] == None: |
143 if not repo.file(f).cmp(m2[f], repo.wread(f)): | 144 if not repo.file(f).cmp(m2[f], repo.wread(f)): |
144 n = m2[f] | 145 n = m2[f] |
145 | 146 |
146 # are files different? | 147 # are files different? |
147 if n != m2[f]: | 148 if n != m2[f]: |