Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 2981:1b738357bba9
merge: fold umap and added into m1 manifest
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 22 Aug 2006 21:02:25 -0500 |
parents | 54d85098fb82 |
children | fe9b13e35e46 87ea5a71f7b9 |
comparison
equal
deleted
inserted
replaced
2980:54d85098fb82 | 2981:1b738357bba9 |
---|---|
111 forget = [] | 111 forget = [] |
112 | 112 |
113 # update m1 from working dir | 113 # update m1 from working dir |
114 umap = dict.fromkeys(unknown) | 114 umap = dict.fromkeys(unknown) |
115 | 115 |
116 for f in added + modified + unknown: | 116 for i,l in (("a", added), ("m", modified), ("u", unknown)): |
117 m1[f] = m1.get(f, nullid) + "+" | 117 for f in l: |
118 m1.set(f, util.is_exec(repo.wjoin(f), m1.execf(f))) | 118 m1[f] = m1.get(f, nullid) + i |
119 m1.set(f, util.is_exec(repo.wjoin(f), m1.execf(f))) | |
119 | 120 |
120 for f in deleted + removed: | 121 for f in deleted + removed: |
121 del m1[f] | 122 del m1[f] |
122 | 123 |
123 # If we're jumping between revisions (as opposed to merging), | 124 # If we're jumping between revisions (as opposed to merging), |
152 # or are we going back in time and clean? | 153 # or are we going back in time and clean? |
153 elif overwrite or m2[f] != a or (backwards and not n[20:]): | 154 elif overwrite or m2[f] != a or (backwards and not n[20:]): |
154 repo.ui.debug(_(" remote %s is newer, get\n") % f) | 155 repo.ui.debug(_(" remote %s is newer, get\n") % f) |
155 action[f] = (m2.execf(f), m2[f], None) | 156 action[f] = (m2.execf(f), m2[f], None) |
156 queued = 1 | 157 queued = 1 |
157 elif f in umap or f in added: | 158 elif n[20:] in ("u","a"): |
158 # this unknown file is the same as the checkout | 159 # this unknown file is the same as the checkout |
159 # we need to reset the dirstate if the file was added | 160 # we need to reset the dirstate if the file was added |
160 action[f] = (m2.execf(f), m2[f], None) | 161 action[f] = (m2.execf(f), m2[f], None) |
161 | 162 |
162 # do we still need to look at mode bits? | 163 # do we still need to look at mode bits? |
182 else: | 183 else: |
183 repo.ui.debug(_("other deleted %s\n") % f) | 184 repo.ui.debug(_("other deleted %s\n") % f) |
184 action[f] = (None, None, None) | 185 action[f] = (None, None, None) |
185 else: | 186 else: |
186 # file is created on branch or in working directory | 187 # file is created on branch or in working directory |
187 if overwrite and f not in umap: | 188 if overwrite and n[20:] != "u": |
188 repo.ui.debug(_("remote deleted %s, clobbering\n") % f) | 189 repo.ui.debug(_("remote deleted %s, clobbering\n") % f) |
189 action[f] = (None, None, None) | 190 action[f] = (None, None, None) |
190 elif not n[20:]: # same as parent | 191 elif not n[20:]: # same as parent |
191 if backwards: | 192 if backwards: |
192 repo.ui.debug(_("remote deleted %s\n") % f) | 193 repo.ui.debug(_("remote deleted %s\n") % f) |