[PATCH 1 of 2 RFC RESEND] bookmarks: allow push to create a new remote head if it is about to be bookmarked via -B

Martin Geisler martin at geisler.net
Tue Sep 10 02:15:45 CDT 2013


FUJIWARA Katsunori <foozy at lares.dti.ne.jp> writes:

> This comment is not for patch itself, but the policy of pushing
> revisions in subrepositories should be clarified before discussing
> about this patch: at least for me :-)
>
> AFAIK, current implementations of each subrepo classes don't support
> partial pushing. "--new-branch" option is passed to
> "localreposiory.push()" in "hgsubrepo.push()", but none of information
> specified by "--rev" (or by "--branch"/"--bookmark" indirectly) is.
>
> So, pushing without "--force" in parent repo fails, if revisions in
> subrepos cause new remote heads, even if "--rev" or such options for
> partial pushing are specified to limit revisions to be pushed on
> parent repo.

I would prefer to delay this subrepo discussion until after the patch is
in since I feel the patch is important and will help the 95% of our
users who don't use subrepositories.

I think that is okay to do since the patch is simply enabling more
pushes to go through without --force. Enabling the remaining cases
(where it makes sense) can be done later.

In table form, I believe the situation today is:

  push   | new heads in | push
  flags  | parent | sub | result
  ==============================
  -B foo | no     | no  | ok
  -B foo | yes    | no  | abort
  -B foo | no     | yes | abort
  -B foo | yes    | yes | abort

That is, new heads in either parent or sub will abort the push. One can
then add --force to make the aborted push go through.

Changing -B foo to allow creating the a new head with bookmark foo would
result in:

  push   | new heads in | push
  flags  | parent | sub | result
  ==============================
  -B foo | no     | no  | ok
  -B foo | yes    | no  | ok
  -B foo | no     | yes | abort
  -B foo | yes    | yes | abort

One can still add --force to turn the remaining two aborts into ok.

-- 
Martin Geisler


More information about the Mercurial-devel mailing list