Patchwork [03,of,11,(19,more,to,go)] push: feed pushoperation object to _pushobsolete function

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 11, 2014, 12:01 a.m.
Message ID <8a7dcb97d9d07f09e9cf.1392076891@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3552/
State Accepted
Commit 6af248474224a2fb0cb616610898fcebe025c5b3
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 1391133369 28800
#      Thu Jan 30 17:56:09 2014 -0800
# Node ID 8a7dcb97d9d07f09e9cf7780005ab1ab814b086d
# Parent  34c68d39d14886e07b7e4a924a8b5c63dd9f7acf
push: feed pushoperation object to _pushobsolete function

This will allow the bookmark synchronisation to have full information on the
ongoing push and pass information to other operation.
Sean Farley - Feb. 11, 2014, 12:19 a.m.
pierre-yves.david@ens-lyon.org writes:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> # Date 1391133369 28800
> #      Thu Jan 30 17:56:09 2014 -0800
> # Node ID 8a7dcb97d9d07f09e9cf7780005ab1ab814b086d
> # Parent  34c68d39d14886e07b7e4a924a8b5c63dd9f7acf
> push: feed pushoperation object to _pushobsolete function
>
> This will allow the bookmark synchronisation to have full information on the
> ongoing push and pass information to other operation.

Is this a copy + paste error from the first patch? It doesn't seem this
patch has anything to do with bookmarks?

> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -245,25 +245,27 @@ def push(repo, remote, force=False, revs
>                                                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.repo, pushop.remote)
> +            _pushobsolete(pushop)
>          finally:
>              if lock is not None:
>                  lock.release()
>      finally:
>          if locallock is not None:
>              locallock.release()
>  
>      _pushbookmark(pushop)
>      return ret
>  
> -def _pushobsolete(repo, remote):
> +def _pushobsolete(pushop):
>      """utility function to push obsolete markers to a remote
>  
>      Exist mostly to allow overriding for experimentation purpose"""
> +    repo = pushop.repo
> +    remote = pushop.remote
>      if (obsolete._enabled and repo.obsstore and
>          'obsolete' in remote.listkeys('namespaces')):
>          rslts = []
>          remotedata = repo.listkeys('obsolete')
>          for key in sorted(remotedata, reverse=True):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Pierre-Yves David - Feb. 11, 2014, 6:34 p.m.
On 02/10/2014 04:19 PM, Sean Farley wrote:
>
> pierre-yves.david@ens-lyon.org writes:
>
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david@logilab.fr>
>> # Date 1391133369 28800
>> #      Thu Jan 30 17:56:09 2014 -0800
>> # Node ID 8a7dcb97d9d07f09e9cf7780005ab1ab814b086d
>> # Parent  34c68d39d14886e07b7e4a924a8b5c63dd9f7acf
>> push: feed pushoperation object to _pushobsolete function
>>
>> This will allow the bookmark synchronisation to have full information on the
>> ongoing push and pass information to other operation.
>
> Is this a copy + paste error from the first patch? It doesn't seem this
> patch has anything to do with bookmarks?

Yes it is.

s/bookmark synchronisation/obsolescence marker exchange/

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -245,25 +245,27 @@  def push(repo, remote, force=False, revs
                                               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.repo, pushop.remote)
+            _pushobsolete(pushop)
         finally:
             if lock is not None:
                 lock.release()
     finally:
         if locallock is not None:
             locallock.release()
 
     _pushbookmark(pushop)
     return ret
 
-def _pushobsolete(repo, remote):
+def _pushobsolete(pushop):
     """utility function to push obsolete markers to a remote
 
     Exist mostly to allow overriding for experimentation purpose"""
+    repo = pushop.repo
+    remote = pushop.remote
     if (obsolete._enabled and repo.obsstore and
         'obsolete' in remote.listkeys('namespaces')):
         rslts = []
         remotedata = repo.listkeys('obsolete')
         for key in sorted(remotedata, reverse=True):