Automatically create new SVN branches from hg branches

Create issue
Issue #15 new
Peter Hosey created an issue

When pushing changes that created a new branch in the hg repository, hgsubversion should automatically create branches in the Subversion repository that don't yet exist.

Comments (7)

  1. Augie Fackler repo owner

    This should be an optional method of pushing - it's also possible the push should send the changesets to the parent branch in Subversion without creating a new branch.

  2. Peter Hosey reporter

    … it's also possible the push should send the changesets to the parent branch in Subversion without creating a new branch.

    That behavior would surprise me.

  3. Luke Opperman

    Have to agree I'd expect branches to be synchronized. I suppose I'm thinking of cases where subversion is the master. If you had limited commit access to a subversion repo or were cloning it and primarily tracking upstream changes you'd want it to be optional and be able to normally reserve branching for hg-only.

    Anyways, aren't we just talking about having a property on csets for whether subversion knows the branch? So have an 'hg svn branch' command that can be used same as hg branch, and additionally sets the subversion-knows flag. Don't know what --unset would mean after it had gone out though, or how this interacts more generally with actual subversion branches / deleting same.

  4. Augie Fackler repo owner

    As of now, no.

    Note that while I'm interested in the tagging from hg feature, I personally lack motivation on this issue (creating branches). I might get to it eventually, but someone motivated enough to provide a patch will definitely beat me to that...

  5. Former user Account Deleted

    My use case: external contractor hired to create feature-x

    My setup: SVN <-> svn-hg

    I create a feature-x branch in svn-hg, put all of my code in it, merge back to default, and then push. The result in SVN is a nicely branched feature that is then merged back to the trunk. I may not even merge back to default to give the client the chance to review the work before they choose to merge.

  6. Arne Babenhauserheide

    I just got bit by the expectation that creating the branch would work. Luckily I did the push with safe changes, so no puppies got harmed, but it was quite surprised.

    Does it work, if I checkout the repo with SVN first, then create the branch and then push?

    A minimal measure to do would be (imo) to deny pushing a change if it will not end up on the same branch as on the branch in Mercurial - or at least requiring -f.

  7. Log in to comment