Mercurial > hg > mercurial-source
diff 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 (2014-08-11) |
parents | 7d7065476fea |
children | 7d1eac06ab2b |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1148,12 +1148,8 @@ lfdirstate = lfutil.openlfdirstate(ui, repo) lfiles = lfutil.listlfiles(repo) - oldlfiles = lfutil.listlfiles(repo, repo[None].parents()[0].rev()) for file in lfiles: - if file in oldlfiles: - lfdirstate.normallookup(file) - else: - lfdirstate.add(file) + lfutil.synclfdirstate(repo, lfdirstate, file, True) lfdirstate.write() finally: wlock.release()