Mercurial > hg > mercurial-source
comparison hgext/largefiles/overrides.py @ 23275:fae708cb32d1
largefiles: avoid printing messages while transplanting by "_lfstatuswriters"
Putting "lambda *msg, **opts: None" (= avoid printing messages always)
into "_lfstatuswriters" while transplanting makes explicit passing
"printmessage = False" for "updatelfiles()" useless.
This patch also removes setting/unsetting "repo._istransplanting" in
"overridetransplant", because there is no code path referring it.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 08 Nov 2014 00:48:41 +0900 |
parents | 0ec2e124fcc0 |
children | 4be754832829 |
comparison
equal
deleted
inserted
replaced
23274:0ec2e124fcc0 | 23275:fae708cb32d1 |
---|---|
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') | 1171 resuming = opts.get('continue') |
1172 repo._lfcommithooks.append(lfutil.automatedcommithook(resuming)) | 1172 repo._lfcommithooks.append(lfutil.automatedcommithook(resuming)) |
1173 try: | 1173 repo._lfstatuswriters.append(lambda *msg, **opts: None) |
1174 repo._istransplanting = True | 1174 try: |
1175 result = orig(ui, repo, *revs, **opts) | 1175 result = orig(ui, repo, *revs, **opts) |
1176 finally: | 1176 finally: |
1177 repo._istransplanting = False | 1177 repo._lfstatuswriters.pop() |
1178 repo._lfcommithooks.pop() | 1178 repo._lfcommithooks.pop() |
1179 return result | 1179 return result |
1180 | 1180 |
1181 def overridecat(orig, ui, repo, file1, *pats, **opts): | 1181 def overridecat(orig, ui, repo, file1, *pats, **opts): |
1182 ctx = scmutil.revsingle(repo, opts.get('rev')) | 1182 ctx = scmutil.revsingle(repo, opts.get('rev')) |
1275 filelist = None | 1275 filelist = None |
1276 if linearmerge: | 1276 if linearmerge: |
1277 newstandins = lfutil.getstandinsstate(repo) | 1277 newstandins = lfutil.getstandinsstate(repo) |
1278 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) | 1278 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) |
1279 | 1279 |
1280 printmessage = None | |
1281 if getattr(repo, "_istransplanting", False): | |
1282 # suppress status message while automated committing | |
1283 printmessage = False | |
1284 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, | 1280 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, |
1285 printmessage=printmessage, | |
1286 normallookup=partial) | 1281 normallookup=partial) |
1287 | 1282 |
1288 return result | 1283 return result |
1289 finally: | 1284 finally: |
1290 wlock.release() | 1285 wlock.release() |