Patchwork [05,of,11,(19,more,to,go)] push: move obsolescence related message into _pushobsolescence function

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 11, 2014, 12:01 a.m.
Message ID <8b97b0a12ed0bdd5c33c.1392076893@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3549/
State Accepted
Commit 46ede894d5a4ab631bf42fb7f765b66463a7bbb0
Headers show

Comments

Pierre-Yves David - Feb. 11, 2014, 12:01 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1391140509 28800
#      Thu Jan 30 19:55:09 2014 -0800
# Node ID 8b97b0a12ed0bdd5c33c56d99ed08342c0a0bc9d
# Parent  c39c0cf5e4cdbc5c375efa5246ed3b07c1d77652
push: move obsolescence related message into _pushobsolescence function

No good reason to have them in the main fonction.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -244,11 +244,10 @@  def push(repo, remote, force=False, revs
                                               str(phases.draft),
                                               str(phases.public))
                     if not r:
                         pushop.ui.warn(_('updating %s to public failed!\n')
                                        % newremotehead)
-            pushop.ui.debug('try to push obsolete markers to remote\n')
             _pushobsolete(pushop)
         finally:
             if lock is not None:
                 lock.release()
     finally:
@@ -258,10 +257,11 @@  def push(repo, remote, force=False, revs
     _pushbookmark(pushop)
     return ret
 
 def _pushobsolete(pushop):
     """utility function to push obsolete markers to a remote"""
+    pushop.ui.debug('try to push obsolete markers to remote\n')
     repo = pushop.repo
     remote = pushop.remote
     if (obsolete._enabled and repo.obsstore and
         'obsolete' in remote.listkeys('namespaces')):
         rslts = []