[PATCH 2 of 2] bookmarks: show details of difference between local and remote bookmarks

David M. Carr david at carrclan.us
Wed Sep 26 07:24:01 CDT 2012


On Wed, Sep 26, 2012 at 7:35 AM, Laurens Holst <laurens.nospam at grauw.nl> wrote:
> Op 26-09-12 11:13, FUJIWARA Katsunori schreef:
>
>> But in the major usecase for bookmark diverging:
>>
>>    1. BOOKMARK refers revision X in shared(= remote) repo
>>    2. Alice pushes newly added revision A to remote, and advances
>>       BOOKMARK to A on remote
>>    3. Bob also added version B and advanced BOOKMARK to B, so
>>    4. Bob pulls revision B from remote, and
>>    5. Bob invokes "hg incoming -B"
>>
>> So, BOOKMARK should be moved on both local and remote side in this
>> case: "even when bookmark is really moved LOCALLY"(= switching to
>> another BRANCH manually) seems to be rare case and ignorable.
>>
>>  From David's reply:
>>
>>      To me, "diverged" indicates that two things moved in different
>>      directions from a common point
>>
>> This fits for "bookmark's moving on both local and remote side" in
>> above usecase.
>>
>> So, showing just "diverged" (without locally/remotely) seems to be
>> suitable for this case, doesn't it ?
>
>
> In step 4 you mean Bub pulls revision *A* from remote, right? This looks to
> be the same scenario as you described in your original mail for (diverged),
> and I think that’s fine.
>
>
>> In the case omitting step (4) above, our conclusion is showing just
>> "changed", isn't it ?
>
>
> Yup.
>
> ~Laurens
>

Note that in step 4 (in Mercurial 2.1+), the divergent remote bookmark
is stored as BOOKMARK at REMOTE, since bookmarks present on the remote
are updated on pull (since Mercurial 2.3, pull only updated bookmarks
present in both local and remote prior to that).  It's possible that
the correct output in step 5 is nothing when step 4 is in place, since
the remote bookmark has already been pulled.

A test for the scenario, to make sure we're talking about the same thing:

Step 1
  $ hg init shared
  $ cd shared
  $ echo alpha > alpha
  $ hg bookmark bookmark
  $ hg commit -Am "add alpha"
  $ hg bookmark
  $ cd ..
  $ hg clone shared alice
  $ hg clone shared bob

Step 2
  $ cd alice
  $ hg update bookmark
  $ echo beta > beta
  $ hg commit -Am "add beta"
  $ hg bookmark
  $ hg push

Step 3
  $ cd bob
  $ hg update bookmark
  $ echo gamma > gamma
  $ hg commit -Am "add gamma"
  $ hg bookmark

Step 4
  $ hg pull

Step 5
  $ hg incoming -B

-- 
David M. Carr
david at carrclan.us


More information about the Mercurial-devel mailing list