Juri Pakaste
Juri Pakaste

Reputation: 1442

Merge Mercurial fork, change branch

We're using Mercurial to manage a project that has two teams working on it. Our team manages the repo, and we're using hg flow on it, with default, develop and feature branches. The other team does their work in a separate repo, with us pulling in their changes every now and then.

The other team isn't particularly up to speed on Mercurial, and they've wanted to do their work on the default branch. This makes pulling in their changes annoying, because we'd like to keep our default branch clean.

We've done what Ned Batchelder suggested in http://nedbatchelder.com/blog/201111/advanced_mercurial_branches.html, but that still leaves commits in our repo with their branch marked as default. So does using Bitbucket's pull requests.

Other options that spring to mind are using patches or using graft and strip. I'd love to hear suggestions that would be less hassle.

Upvotes: 3

Views: 179

Answers (2)

Ry4an Brase
Ry4an Brase

Reputation: 78330

Or consider using bookmarks instead of named branches. Then you can move their changesets into your develop bookmark without any of its past default-ness showing through.

hey're not entirely crazy for wanting to develop in the default branch; it's the standard advice: https://www.mercurial-scm.org/wiki/StandardBranching#Don.27t_use_a_name_other_than_default_for_your_main_development_branch

Upvotes: 0

Lazy Badger
Lazy Badger

Reputation: 97270

If you want "Hard way, but nice results" you have to forget about easy pure-Bitbucket interface of syncing repositories

With Convert Extension --branchmap option you can rename any branch in source repository into any name. Thus, your workflow will be something like:

  • Prepare file for branch-mapping
  • Clone|pull from fork to local repository
  • Convert cloned repo, using branchmap, into repository with good naming of branch(es)
  • Push result of convert into your Bitbucket0repository

Upvotes: 1

Related Questions