comparison of bookmarks at incoming/outgoing

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Aug 20 05:21:24 CDT 2012


At Fri, 17 Aug 2012 21:22:17 -0500,
Matt Mackall wrote:
> 
> On Fri, 2012-08-03 at 16:49 +0900, FUJIWARA Katsunori wrote:
> > Hi, devel.
> > 
> > Now, "--bookmarks" option for "hg incoming" and "hg outgoing" causes
> > comparison of bookmarks between local repository and other one.
> > 
> > And this shows messages using "changed" word like:
> > 
> >     - "searching for changed bookmarks"
> >     - "no changed bookmarks found"
> > 
> > But this comparison only compares set of bookmark names in each
> > repositories.
> 
> Correct. I think we should change the wording of all the messages here. 
> Ideally, we'd like to report:
> 
> - new (and with outgoing, won't be pushed, ie local)
> - advanced remotely
> - advanced locally
> - divergent
> 
> ..though it might be impossible to reliably distinguish the last three
> at in/out time.

As you described above, it might be impossible to distinguish the last
three ALWAYS in reasonable costs.

So, what about adding HINT information like below ?

  - it is assumed that bookmarks points:
    - REV-L on local side
    - REV-R on remote side

  - if local repo has REV-R:

    - if common ancestor of REV-L and REV-R is none of each:
      show "divergent" as hint

    - otherwise:
      - if common ancestor of them is REV-L:
        show "advanced remotely" as hint

      - otherwise:
        show "advanced locally" as hint

  - otherwise:

    REV-R should be the revision newly added on remote, so "advanced
    locally" can be ignored in this case.

    but there is no other information (in reasonable costs) to
    determine relation between REV-L and REV-R, so show "advanced
    remotely or divergent" as hint

If users really want to know exact information about remote bookmarks
in "advanced remotely or divergent" case, they can see it after "hg
pull" without any -B options which pulls REV-R from remote.

If getting common ancestor of two revisions in local repo is not so
cheap, we should do:

  - if local repo has REV-R:

    - if REV-R < REV-L:
      show "advanced locally or divergent"

    - otherwise:
      show "advanced remotely or divergent"

Even though hint is not exact information in some cases, it seems to
be better than showing none about bookmarks for many users.

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list