[PATCH 0 of 4] Clone and update without revision update to bookmark master or <branch>/master.

arne_bab at web.de arne_bab at web.de
Fri Nov 4 04:42:05 CDT 2011


Hi, 

This is the reworked patch series, with “getting the bookmarks before updating a clone” factored into its own commit.

--- previous intro ---

Bookmarks as they are don’t work really well for me, because I cannot use them as nonpermanent branching model while still making sure that people who clone my repository or pull and do an empty update get a working revision.

This patchseries addresses that issue by adapting the behavior of clone and update in case a master or <branch>/master bookmark is present:

* Clone: If there is a bookmark named master, clone chooses it as initial revision, regardless of the branch it resides on. This can also be used to mark another branch than the default branch as initial branch.
* Update: If it is called without revision and there is a bookmark named master or <branchname>/master on the current branch (<branchname>), the bookmark is selected as target revision.

Usecases: 

* Set the initial revision for new contributors.
* Push still-worked-on revisions without disturbing other contributors and without storing branch information in the commits.

Possible improvements: 

* Add a flag to push: --new-bookmarked-head: Allow pushing a head with a bookmark, when there is a master or <branch>/master bookmark on the branch. In essence: Allow pushing safe heads.

TODO: Add tests (I need help for that)

Best wishes,
Arne


More information about the Mercurial-devel mailing list