Mercurial > hg
comparison hgext/largefiles/overrides.py @ 22096:61e526585b20
largefiles: restore R status of removed largefiles correctly at "hg rollback"
Before this patch, removed or forgotten largefiles aren't treated as
removed ("R") after "hg rollback". Removed ones are treated as missing
("!") and forgotten ones are treated as clean ("C") unexpectedly.
"overriderollback" uses "normallookup" to restore status in lfdirstate
for largefiles other than ones not added in rollback-ed revision, but
this isn't correct for removed (or forgotten) largefiles.
This patch uses "lfutil.synclfdirstate" to restore "R" status of
removed (or forgotten) largefiles correctly at "hg rollback".
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, lfdirstate should
be rollback-ed as a part of transaction, as same as dirstate.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 11 Aug 2014 22:29:43 +0900 |
parents | 7d7065476fea |
children | 7d1eac06ab2b |
comparison
equal
deleted
inserted
replaced
22095:cb62d77c7a01 | 22096:61e526585b20 |
---|---|
1146 merge.update(repo, node=None, branchmerge=False, force=True, | 1146 merge.update(repo, node=None, branchmerge=False, force=True, |
1147 partial=lfutil.isstandin) | 1147 partial=lfutil.isstandin) |
1148 | 1148 |
1149 lfdirstate = lfutil.openlfdirstate(ui, repo) | 1149 lfdirstate = lfutil.openlfdirstate(ui, repo) |
1150 lfiles = lfutil.listlfiles(repo) | 1150 lfiles = lfutil.listlfiles(repo) |
1151 oldlfiles = lfutil.listlfiles(repo, repo[None].parents()[0].rev()) | |
1152 for file in lfiles: | 1151 for file in lfiles: |
1153 if file in oldlfiles: | 1152 lfutil.synclfdirstate(repo, lfdirstate, file, True) |
1154 lfdirstate.normallookup(file) | |
1155 else: | |
1156 lfdirstate.add(file) | |
1157 lfdirstate.write() | 1153 lfdirstate.write() |
1158 finally: | 1154 finally: |
1159 wlock.release() | 1155 wlock.release() |
1160 return result | 1156 return result |
1161 | 1157 |