Patchwork [9,of,9,V2] largefiles: avoid printing messages while rebasing by "_lfstatuswriters"

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Nov. 5, 2014, 2:34 p.m.
Message ID <383ff455cab88abe4c34.1415198058@feefifofum>
Download mbox | patch
Permalink /patch/6583/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - Nov. 5, 2014, 2:34 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1415197487 -32400
#      Wed Nov 05 23:24:47 2014 +0900
# Node ID 383ff455cab88abe4c34ffb3d534b4d19e1c71da
# Parent  fb139f5553d6895779ba156ad69a2efaecb9c430
largefiles: avoid printing messages while rebasing by "_lfstatuswriters"

Putting "lambda *msg, **opts: None" (= avoid printing messages always)
into "_lfstatuswriters" while rebasing makes explicit passing
"printmessage = False" for "updatelfiles()" useless.

This patch also removes setting/unsetting "repo._isrebasing" in
"overriderebase", because there is no code path referring it.
Matt Mackall - Nov. 5, 2014, 4:42 p.m.
On Wed, 2014-11-05 at 23:34 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1415197487 -32400
> #      Wed Nov 05 23:24:47 2014 +0900
> # Node ID 383ff455cab88abe4c34ffb3d534b4d19e1c71da
> # Parent  fb139f5553d6895779ba156ad69a2efaecb9c430
> largefiles: avoid printing messages while rebasing by "_lfstatuswriters"

These are queued for default, thanks.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -792,11 +792,11 @@ 
 def overriderebase(orig, ui, repo, **opts):
     resuming = opts.get('continue')
     repo._lfcommithooks.append(lfutil.automatedcommithook(resuming))
-    repo._isrebasing = True
+    repo._lfstatuswriters.append(lambda *msg, **opts: None)
     try:
         return orig(ui, repo, **opts)
     finally:
-        repo._isrebasing = False
+        repo._lfstatuswriters.pop()
         repo._lfcommithooks.pop()
 
 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
@@ -1280,8 +1280,7 @@ 
             filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
 
         printmessage = None
-        if (getattr(repo, "_isrebasing", False) or
-            getattr(repo, "_istransplanting", False)):
+        if getattr(repo, "_istransplanting", False):
             # suppress status message while automated committing
             printmessage = False
         lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,