comparison hgext/largefiles/overrides.py @ 23273:236c978bceca

largefiles: avoid redundant "updatelfiles" invocation in "overridetransplant" At "hg transplant --merge REV", largefiles newly coming from the 2nd parent (= REV) are marked as "a"(dded) by "patch.patch()", and have to be marked as "n"(ormal) after commit. But until changeset 3100d1cbce32, such largefiles were still marked as "a" unexpectedly even after commit, because no additional entry is added to filelog of such largefiles and they aren't listed in "repo[newnode].files()" in this case: "newnode" is one of newly committed changeset (= result of "repo.commit()"). "updatelfiles" invocation in "overridetransplant" shadows this problem by forcibly synchronizing lfdirstate to dirstate. Now, "updatelfiles" invocation in "overridetransplant" is redundant, because changeset 3100d1cbce32 made "markcommitted" use "ctx.files()" to get targets of "synclfdirstate" instead of "repo[newnode].files()".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 08 Nov 2014 00:48:38 +0900
parents 383ff455cab8
children 0ec2e124fcc0
comparison
equal deleted inserted replaced
23272:394c79df66c3 23273:236c978bceca
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 try: 1171 try:
1172 oldstandins = lfutil.getstandinsstate(repo)
1173 repo._istransplanting = True 1172 repo._istransplanting = True
1174 result = orig(ui, repo, *revs, **opts) 1173 result = orig(ui, repo, *revs, **opts)
1175 newstandins = lfutil.getstandinsstate(repo)
1176 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1177 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1178 printmessage=True)
1179 finally: 1174 finally:
1180 repo._istransplanting = False 1175 repo._istransplanting = False
1181 return result 1176 return result
1182 1177
1183 def overridecat(orig, ui, repo, file1, *pats, **opts): 1178 def overridecat(orig, ui, repo, file1, *pats, **opts):