Mercurial > hg
comparison hgext/largefiles/overrides.py @ 22094:7d7065476fea
largefiles: put whole rollback-ing process into the same "wlock" scope
Before this patch, there are three distinct "wlock" scopes in
"overriderollback":
1. "localrepository.rollback" via original "rollback" command,
2. "merge.update" for reverting standin files only, and
3. "overriderollback" specific "wlock" scope (to synchronize
largefile dirstate)
But these should be executed in the same "wlock" scope for
consistency.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 11 Aug 2014 22:29:43 +0900 |
parents | 0cb34b3991f8 |
children | 61e526585b20 |
comparison
equal
deleted
inserted
replaced
22093:45611a306f77 | 22094:7d7065476fea |
---|---|
1138 repo.status = overridestatus | 1138 repo.status = overridestatus |
1139 orig(ui, repo, *dirs, **opts) | 1139 orig(ui, repo, *dirs, **opts) |
1140 repo.status = oldstatus | 1140 repo.status = oldstatus |
1141 | 1141 |
1142 def overriderollback(orig, ui, repo, **opts): | 1142 def overriderollback(orig, ui, repo, **opts): |
1143 result = orig(ui, repo, **opts) | |
1144 merge.update(repo, node=None, branchmerge=False, force=True, | |
1145 partial=lfutil.isstandin) | |
1146 wlock = repo.wlock() | 1143 wlock = repo.wlock() |
1147 try: | 1144 try: |
1145 result = orig(ui, repo, **opts) | |
1146 merge.update(repo, node=None, branchmerge=False, force=True, | |
1147 partial=lfutil.isstandin) | |
1148 | |
1148 lfdirstate = lfutil.openlfdirstate(ui, repo) | 1149 lfdirstate = lfutil.openlfdirstate(ui, repo) |
1149 lfiles = lfutil.listlfiles(repo) | 1150 lfiles = lfutil.listlfiles(repo) |
1150 oldlfiles = lfutil.listlfiles(repo, repo[None].parents()[0].rev()) | 1151 oldlfiles = lfutil.listlfiles(repo, repo[None].parents()[0].rev()) |
1151 for file in lfiles: | 1152 for file in lfiles: |
1152 if file in oldlfiles: | 1153 if file in oldlfiles: |