Mercurial repository layout for multiple branches?

Multiple repositories, Forests and SubRepos are all variants on the same idea. Forests and SubRepos just make managing projects that also use extremely recent versions of other projects easier, they don't solve the basic problem you have, which is that you lose file history when moving them between projects In my opinion, your best bet is to put all the directories in the same repository and wait for the Mercurial feature to allow checkout of subdirectories. The subdirectory feature is one the Mercurial team cares about, but it's not trivial to do either, which is why it hasn't been done yet.

I know the Mercurial internals though, and it's definitely doable, just a lot of work The second best option, though I consider it really ugly, is the named branches idea you mentioned. You will still have a very weird merge operation to perform whenever you want to copy files between branches though. You will perform these steps: Update to head of the branch you want to copy the file into: hg update -C project1 Merge in the branch you want to copy the file from: HGMERGE=/bin/false hg merge -r project2 Revert to the head of the branch you want to copy the file into: hg revert -a --no-backup -r project1 Revert the specific file you want to copy from the head revision of the merged in branch: hg revert --no-backup -r project2 path/to/file/in/project2.

Txt Move the file into it's place in the branch you want to copy it to: hg mv path/to/file/in/project2. Txt project1/file/path/project2. Txt Mark the merge as resolved: hg resolve -am And finally commit the result: hg commit -m "A merge to copy project2.

Txt to project1 As I said, very ugly. And it might well only work well in hg 1.3 since I know some important bugs in the interaction of revert, merge and resolve were fixed fairly recently. (IMHO, I suspect Ubuntu is purposely behind on versions of non-bzr version control systems.) How often do you really expect to be copying files between projects?

Why would it happen? Are you sure that losing history would be that bad of a thing? I've done something similar in Subversion for a couple of projects of my own, but my experience is that my initial feeling about which project something really belonged in was usually correct, and when it wasn't preserving history wasn't really that big a deal since the history was really only relevant to the original project the file was in anyway.

Multiple repositories, Forests and SubRepos are all variants on the same idea. Forests and SubRepos just make managing projects that also use extremely recent versions of other projects easier, they don't solve the basic problem you have, which is that you lose file history when moving them between projects. In my opinion, your best bet is to put all the directories in the same repository and wait for the Mercurial feature to allow checkout of subdirectories.

The subdirectory feature is one the Mercurial team cares about, but it's not trivial to do either, which is why it hasn't been done yet. I know the Mercurial internals though, and it's definitely doable, just a lot of work. The second best option, though I consider it really ugly, is the named branches idea you mentioned.

You will still have a very weird merge operation to perform whenever you want to copy files between branches though. You will perform these steps: Update to head of the branch you want to copy the file into: hg update -C project1 Merge in the branch you want to copy the file from: HGMERGE=/bin/false hg merge -r project2 Revert to the head of the branch you want to copy the file into: hg revert -a --no-backup -r project1 Revert the specific file you want to copy from the head revision of the merged in branch: hg revert --no-backup -r project2 path/to/file/in/project2. Txt Move the file into it's place in the branch you want to copy it to: hg mv path/to/file/in/project2.

Txt project1/file/path/project2. Txt Mark the merge as resolved: hg resolve -am And finally commit the result: hg commit -m "A merge to copy project2. Txt to project1."

As I said, very ugly. And it might well only work well in hg 1.3 since I know some important bugs in the interaction of revert, merge and resolve were fixed fairly recently. (IMHO, I suspect Ubuntu is purposely behind on versions of non-bzr version control systems.) How often do you really expect to be copying files between projects?

Why would it happen? Are you sure that losing history would be that bad of a thing? I've done something similar in Subversion for a couple of projects of my own, but my experience is that my initial feeling about which project something really belonged in was usually correct, and when it wasn't preserving history wasn't really that big a deal since the history was really only relevant to the original project the file was in anyway.

Wow, thanks for the named branch steps. That's way too ugly to consider. I'll just deal with losing history–it was a fairly rare case anyway.

Actually, a bigger problem than merging changes between projects is synchronizing dependencies. I.e. Project1@r50 needs database@r50.

This can be done with svn, although it requires a slightly more complicated checkout than I gave above. – Quantum7 Oct 27 '09 at 2:58 Synchronizing dependencies is exactly what SubRepos and Forests are for. – Omnifarious Oct 27 '09 at 3:01 1 To further elaborate, I consider SubRepos and Forests to be an implementation of svn:externals for Mercurial, and with the Mercurial mindset that meta-data should be stored explicitly in files rather than implicitly attached to them and managed with special purpose VCS commands.

– Omnifarious Oct 27 '09 at 3:03.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions