Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 576:da11baf5de7b
Handle unknown files better on update
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Handle unknown files better on update
If we spot an unknown file that's identical to one that's in the
update, we get the updated one so that it shows up in the dirstate
properly.
manifest hash: 988aca64f255df67c27d1c6f8694ea098e4ec159
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCxyFyywK+sNU5EO8RAjmiAKCTgINXMPB1CxHt0OgHYPucfjCS7QCcDpJJ
VgKqZS54hTAWN3jL2yllUhI=
=iPQD
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Sat, 02 Jul 2005 15:21:22 -0800 |
parents | 7f5ce4bbdd7b |
children | e33c85d2812a |
comparison
equal
deleted
inserted
replaced
575:7f5ce4bbdd7b | 576:da11baf5de7b |
---|---|
1090 mark = {} | 1090 mark = {} |
1091 | 1091 |
1092 # construct a working dir manifest | 1092 # construct a working dir manifest |
1093 mw = m1.copy() | 1093 mw = m1.copy() |
1094 mfw = mf1.copy() | 1094 mfw = mf1.copy() |
1095 umap = dict.fromkeys(u) | |
1096 | |
1095 for f in a + c + u: | 1097 for f in a + c + u: |
1096 mw[f] = "" | 1098 mw[f] = "" |
1097 mfw[f] = util.is_exec(self.wjoin(f), mfw.get(f, False)) | 1099 mfw[f] = util.is_exec(self.wjoin(f), mfw.get(f, False)) |
1100 | |
1098 for f in d: | 1101 for f in d: |
1099 if f in mw: del mw[f] | 1102 if f in mw: del mw[f] |
1100 | 1103 |
1101 # If we're jumping between revisions (as opposed to merging), | 1104 # If we're jumping between revisions (as opposed to merging), |
1102 # and if neither the working directory nor the target rev has | 1105 # and if neither the working directory nor the target rev has |
1104 # prevent the dirstate from listing the file when it is no | 1107 # prevent the dirstate from listing the file when it is no |
1105 # longer in the manifest. | 1108 # longer in the manifest. |
1106 if linear_path and f not in m2: | 1109 if linear_path and f not in m2: |
1107 self.dirstate.forget((f,)) | 1110 self.dirstate.forget((f,)) |
1108 | 1111 |
1112 # Compare manifests | |
1109 for f, n in mw.iteritems(): | 1113 for f, n in mw.iteritems(): |
1110 if f in m2: | 1114 if f in m2: |
1111 s = 0 | 1115 s = 0 |
1112 | 1116 |
1113 # is the wfile new since m1, and match m2? | 1117 # is the wfile new since m1, and match m2? |
1138 self.ui.debug(" remote %s is newer, get\n" % f) | 1142 self.ui.debug(" remote %s is newer, get\n" % f) |
1139 get[f] = m2[f] | 1143 get[f] = m2[f] |
1140 s = 1 | 1144 s = 1 |
1141 else: | 1145 else: |
1142 mark[f] = 1 | 1146 mark[f] = 1 |
1147 elif f in umap: | |
1148 # this unknown file is the same as the checkout | |
1149 get[f] = m2[f] | |
1143 | 1150 |
1144 if not s and mfw[f] != mf2[f]: | 1151 if not s and mfw[f] != mf2[f]: |
1145 if force: | 1152 if force: |
1146 self.ui.debug(" updating permissions for %s\n" % f) | 1153 self.ui.debug(" updating permissions for %s\n" % f) |
1147 util.set_exec(self.wjoin(f), mf2[f]) | 1154 util.set_exec(self.wjoin(f), mf2[f]) |