Patchwork [3,of,4] largefiles: avoid printing messages while transplanting by "_lfstatuswriters"

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Nov. 7, 2014, 3:52 p.m.
Message ID <7cbd61c8c2fca255998d.1415375527@feefifofum>
Download mbox | patch
Permalink /patch/6635/
State Accepted
Commit fae708cb32d135de2aaf792fbc689f9c830970c8
Headers show

Comments

Katsunori FUJIWARA - Nov. 7, 2014, 3:52 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1415375321 -32400
#      Sat Nov 08 00:48:41 2014 +0900
# Node ID 7cbd61c8c2fca255998dba9c1a67f769c6f5e6d3
# Parent  a8cd62059369d30589cf45ffafd0f8d5ce76daf3
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.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1170,11 +1170,11 @@ 
 def overridetransplant(orig, ui, repo, *revs, **opts):
     resuming = opts.get('continue')
     repo._lfcommithooks.append(lfutil.automatedcommithook(resuming))
-    try:
-        repo._istransplanting = True
+    repo._lfstatuswriters.append(lambda *msg, **opts: None)
+    try:
         result = orig(ui, repo, *revs, **opts)
     finally:
-        repo._istransplanting = False
+        repo._lfstatuswriters.pop()
         repo._lfcommithooks.pop()
     return result
 
@@ -1277,12 +1277,7 @@ 
             newstandins = lfutil.getstandinsstate(repo)
             filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
 
-        printmessage = None
-        if getattr(repo, "_istransplanting", False):
-            # suppress status message while automated committing
-            printmessage = False
         lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
-                                printmessage=printmessage,
                                 normallookup=partial)
 
         return result