[Patch] Allow mapping trunk to a different branch

Create issue
Issue #172 open
Johannes Pfau created an issue

Currently it is not possible to transform the svn trunk into a hg named branch. This simple patch adds support for that using the branchmap feature. A trunk mapping in the branch file will look like this: {{{ =svn-trunk }}} and mean apply all changes from trunk in the named branch 'svn-trunk'

Comments (4)

  1. Dan Villiom Podlaski Christiansen

    After giving this some though, I think the basic approach is good. I do have one gripe with the patch: I don't think we should have lines that start with an equal sign in the maps. Instead, I'd prefer it to be mapped as simply ‘trunk = somethingelse’.[*] Additionally, it would be nice if you could extend it to also allow mapping another branch to the default branch, using e.g. ‘dist = default’. Finally, you should add unit tests of any added functionality, so that we know it works now, and we won't accidentally break it in the future.

    (I was going to complain about documentation as well, but there isn't any to begin with, so requiring it wouldn't be unreasonable…)

    If it's not too much trouble, could you please send an updated patch to the list? Preferably using the patchbomb extension; it makes review much easier.

    [*] Theoretically, this could cause problems for someone silly enough to have a branch named ‘trunk’. According to Google Code Search, such people do exist. It seems to me to be a rare enough case we could justify not handling it gracefully. Augie, do you have an opinion on this?

  2. Johannes Pfau reporter

    Hi, thanks for looking into this. I feared that naming a branch 'trunk' would be possible in svn, but never really looked it up. So it turns out something as stupid can really be done.

    About the patch: I don't really like it either but I have to admit I don't really 'speak' python. I can just read it and copy / paste one liners, so this was the best I could come up with. I don't think I could implement a correct patch complete with unit tests and the like, sorry.

    However, for me this workaround is enough and as nobody else has requested such a feature I guess it's rather rarely used anyway. So I think it's rather low priority and there's no need to rush an implementation.

  3. Log in to comment