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

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Fri Nov 7 09:52:07 CST 2014


# HG changeset patch
# User FUJIWARA Katsunori <foozy at 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.

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


More information about the Mercurial-devel mailing list