Patchwork [1,of,6] push: update bookmark within the remote lock

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 18, 2014, 9:49 p.m.
Message ID <cef89d04868a41c6e1a7.1408398599@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5472/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 18, 2014, 9:49 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1408141512 25200
#      Fri Aug 15 15:25:12 2014 -0700
# Node ID cef89d04868a41c6e1a7951e9f2add046fcc681c
# Parent  8dda6f6ff564d8fe6ac7b8ce4c74eb9bfb5de14a
push: update bookmark within the remote lock

Update the bookmark is part of the push. It should be done within the same lock
than the other steps of the push.
Gregory Szorc - Aug. 18, 2014, 11:54 p.m.
On 8/18/2014 2:49 PM, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1408141512 25200
> #      Fri Aug 15 15:25:12 2014 -0700
> # Node ID cef89d04868a41c6e1a7951e9f2add046fcc681c
> # Parent  8dda6f6ff564d8fe6ac7b8ce4c74eb9bfb5de14a
> push: update bookmark within the remote lock
> 
> Update the bookmark is part of the push. It should be done within the same lock
> than the other steps of the push.
> 
> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -185,18 +185,18 @@ def push(repo, remote, force=False, revs
>                  and pushop.remote.capable('bundle2-exp')):
>                  _pushbundle2(pushop)
>              _pushchangeset(pushop)
>              _pushsyncphase(pushop)
>              _pushobsolete(pushop)
> +            _pushbookmark(pushop)
>          finally:
>              if lock is not None:
>                  lock.release()
>      finally:
>          if locallock is not None:
>              locallock.release()
>  
> -    _pushbookmark(pushop)
>      return pushop.ret
>  
>  # list of steps to perform discovery before push
>  pushdiscoveryorder = []

Bah, you just changed the behavior of some of my extensions.

Because there's no "do post push things with the pushop instance" hook
point, I was overloading _pushbookmark() to do all the "post push
things" in a few of my extensions. I may have to revive some of my "add
instance hooks/events to repo instances" patches and get them into 3.2...
Augie Fackler - Aug. 18, 2014, 11:57 p.m.
On Mon, Aug 18, 2014 at 04:54:04PM -0700, Gregory Szorc wrote:
> On 8/18/2014 2:49 PM, Pierre-Yves David wrote:
> > # HG changeset patch
> > # User Pierre-Yves David <pierre-yves.david@fb.com>
> > # Date 1408141512 25200
> > #      Fri Aug 15 15:25:12 2014 -0700
> > # Node ID cef89d04868a41c6e1a7951e9f2add046fcc681c
> > # Parent  8dda6f6ff564d8fe6ac7b8ce4c74eb9bfb5de14a
> > push: update bookmark within the remote lock
> >
> > Update the bookmark is part of the push. It should be done within the same lock
> > than the other steps of the push.
> >
> > diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> > --- a/mercurial/exchange.py
> > +++ b/mercurial/exchange.py
> > @@ -185,18 +185,18 @@ def push(repo, remote, force=False, revs
> >                  and pushop.remote.capable('bundle2-exp')):
> >                  _pushbundle2(pushop)
> >              _pushchangeset(pushop)
> >              _pushsyncphase(pushop)
> >              _pushobsolete(pushop)
> > +            _pushbookmark(pushop)
> >          finally:
> >              if lock is not None:
> >                  lock.release()
> >      finally:
> >          if locallock is not None:
> >              locallock.release()
> >
> > -    _pushbookmark(pushop)
> >      return pushop.ret
> >
> >  # list of steps to perform discovery before push
> >  pushdiscoveryorder = []
>
> Bah, you just changed the behavior of some of my extensions.
>
> Because there's no "do post push things with the pushop instance" hook
> point, I was overloading _pushbookmark() to do all the "post push
> things" in a few of my extensions. I may have to revive some of my "add
> instance hooks/events to repo instances" patches and get them into 3.2...

If there's no way to do it anymore, we should very likely talk.

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Pierre-Yves David - Aug. 18, 2014, 11:58 p.m.
On 08/18/2014 04:54 PM, Gregory Szorc wrote:
> On 8/18/2014 2:49 PM, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david@fb.com>
>> # Date 1408141512 25200
>> #      Fri Aug 15 15:25:12 2014 -0700
>> # Node ID cef89d04868a41c6e1a7951e9f2add046fcc681c
>> # Parent  8dda6f6ff564d8fe6ac7b8ce4c74eb9bfb5de14a
>> push: update bookmark within the remote lock
>>
>> Update the bookmark is part of the push. It should be done within the same lock
>> than the other steps of the push.
>>
>> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
>> --- a/mercurial/exchange.py
>> +++ b/mercurial/exchange.py
>> @@ -185,18 +185,18 @@ def push(repo, remote, force=False, revs
>>                   and pushop.remote.capable('bundle2-exp')):
>>                   _pushbundle2(pushop)
>>               _pushchangeset(pushop)
>>               _pushsyncphase(pushop)
>>               _pushobsolete(pushop)
>> +            _pushbookmark(pushop)
>>           finally:
>>               if lock is not None:
>>                   lock.release()
>>       finally:
>>           if locallock is not None:
>>               locallock.release()
>>
>> -    _pushbookmark(pushop)
>>       return pushop.ret
>>
>>   # list of steps to perform discovery before push
>>   pushdiscoveryorder = []
>
> Bah, you just changed the behavior of some of my extensions.
>
> Because there's no "do post push things with the pushop instance" hook
> point, I was overloading _pushbookmark() to do all the "post push
> things" in a few of my extensions. I may have to revive some of my "add
> instance hooks/events to repo instances" patches and get them into 3.2...

http://xkcd.com/1172/

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -185,18 +185,18 @@  def push(repo, remote, force=False, revs
                 and pushop.remote.capable('bundle2-exp')):
                 _pushbundle2(pushop)
             _pushchangeset(pushop)
             _pushsyncphase(pushop)
             _pushobsolete(pushop)
+            _pushbookmark(pushop)
         finally:
             if lock is not None:
                 lock.release()
     finally:
         if locallock is not None:
             locallock.release()
 
-    _pushbookmark(pushop)
     return pushop.ret
 
 # list of steps to perform discovery before push
 pushdiscoveryorder = []