Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 35022:0ba3b928f9a9 stable
amend: do not take untracked files as modified or clean (issue5732)
fctx.exists() shouldn't be used here as it checks if a file physically exists,
which may disagree with the dirstate.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 04 Nov 2017 23:45:59 +0900 |
parents | 527655a049ee |
children | 5f40efa472db |
comparison
equal
deleted
inserted
replaced
35021:b69c700b6de6 | 35022:0ba3b928f9a9 |
---|---|
3178 # the working copy are being amended but there are also | 3178 # the working copy are being amended but there are also |
3179 # changes to other files from the old changeset. | 3179 # changes to other files from the old changeset. |
3180 if path not in filestoamend: | 3180 if path not in filestoamend: |
3181 return old.filectx(path) | 3181 return old.filectx(path) |
3182 | 3182 |
3183 # Return None for removed files. | |
3184 if path in wctx.removed(): | |
3185 return None | |
3186 | |
3183 fctx = wctx[path] | 3187 fctx = wctx[path] |
3184 | |
3185 # Return None for removed files. | |
3186 if not fctx.exists(): | |
3187 return None | |
3188 | |
3189 flags = fctx.flags() | 3188 flags = fctx.flags() |
3190 mctx = context.memfilectx(repo, | 3189 mctx = context.memfilectx(repo, |
3191 fctx.path(), fctx.data(), | 3190 fctx.path(), fctx.data(), |
3192 islink='l' in flags, | 3191 islink='l' in flags, |
3193 isexec='x' in flags, | 3192 isexec='x' in flags, |