comparison hgext/largefiles/overrides.py @ 23274:0ec2e124fcc0

largefiles: update standins only at the 1st commit of "transplant --continue" Before this patch, "hg transplant --continue" may record incorrect standins, because largefiles extension always avoid updating standins while transplanting, even though largefiles in the working directory may be modified manually at the 1st commit of "hg transplant --continue". But, on the other hand, updating standins should be avoided at subsequent commits for efficiency reason. To update standins only at the 1st commit of "hg transplant --continue", this patch uses "automatedcommithook", which updates standins by "lfutil.updatestandinsbymatch()" only at the 1st commit of resuming. Even after this patch, "repo._istransplanting = True" is still needed to avoid some status report while updating largefiles in "lfcommands.updatelfiles()". This is reason why this patch omits not "repo._istransplanting = True" in "overriderebase" but examination of "getattr(repo, "_istransplanting", False)" in "updatestandinsbymatch".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 08 Nov 2014 00:48:41 +0900
parents 236c978bceca
children fae708cb32d1
comparison
equal deleted inserted replaced
23273:236c978bceca 23274:0ec2e124fcc0
1166 finally: 1166 finally:
1167 wlock.release() 1167 wlock.release()
1168 return result 1168 return result
1169 1169
1170 def overridetransplant(orig, ui, repo, *revs, **opts): 1170 def overridetransplant(orig, ui, repo, *revs, **opts):
1171 resuming = opts.get('continue')
1172 repo._lfcommithooks.append(lfutil.automatedcommithook(resuming))
1171 try: 1173 try:
1172 repo._istransplanting = True 1174 repo._istransplanting = True
1173 result = orig(ui, repo, *revs, **opts) 1175 result = orig(ui, repo, *revs, **opts)
1174 finally: 1176 finally:
1175 repo._istransplanting = False 1177 repo._istransplanting = False
1178 repo._lfcommithooks.pop()
1176 return result 1179 return result
1177 1180
1178 def overridecat(orig, ui, repo, file1, *pats, **opts): 1181 def overridecat(orig, ui, repo, file1, *pats, **opts):
1179 ctx = scmutil.revsingle(repo, opts.get('rev')) 1182 ctx = scmutil.revsingle(repo, opts.get('rev'))
1180 err = 1 1183 err = 1