Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Enhancement: Add config option to not push branches that do not begin with branch/ prefix #7

Open
nathanielcook opened this issue Dec 3, 2015 · 1 comment

Comments

@nathanielcook
Copy link

When creating a branch one might forget to add the branches/ prefix. When such a branch is pushed, that branch becomes a Mercurial bookmark, which is a bit of a pain to remove when working with git-remote-hg. (For some discussion on this, see here.) Also we then have to create a new branch at that point, which creates some duplication that could have been avoided had we been alerted somehow of our mistake. It would be really great if developers who do not use hg bookmarks could somehow block creating them inadvertently during push.

@nathanielcook
Copy link
Author

For those that want a quick hack, this seems to work for me so far. Put a die statement at line 1144, in do_export.

...
elif ref.startswith('refs/heads/'):
    # bomb completely if there are commits that won't end up in an hg named branch
    die('did you forget to add the branches prefix?')
    ....

@fingolfin Are there any negative side effects to this hack that you know of?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant