Mercurial to Mercurial to Subversion Workflow Problem?

You're not doing anything wrong, in fact in your situation the behavior you're seeing is the expected (if somewhat confusing to a new Mercurial user) result hgsubversion is really good for two things: using Mercurial as a client for Subversion, without exchanging changes outside of svn Converting Subversion repositories to Mercurial You're trying to use it as a more generalized gateway, which is a much much harder problem. Subversion has a very rigid view of the world, and we have to work within that. The truth of the matter is that the revision hash can only be viewed as final when using hgsubversion after the revision has been pulled from Subversion.

Thus, if your developers ever share changesets between Mercurial repositories directly, without Subversion as an intermediary, this will occur The rebase is automatic and non-optional for a very fundamental reason: Subversion performs that rebase when you push. If you had unpulled changes when you pushed, Subversion did that rebase for you, and if successful (with a stupidly simple rebasing algorithm) it accepts the commit with no indication that a rebase occurred. We're patching together two different models I'd recommend moving everyone over to Mercurial at once - a hybrid approach like this is only going to make using Mercurial more difficult in the short term than it needs to be, and potentially confuse users new to DVCS.

You're not doing anything wrong, in fact in your situation the behavior you're seeing is the expected (if somewhat confusing to a new Mercurial user) result. Hgsubversion is really good for two things: using Mercurial as a client for Subversion, without exchanging changes outside of svn Converting Subversion repositories to Mercurial You're trying to use it as a more generalized gateway, which is a much much harder problem. Subversion has a very rigid view of the world, and we have to work within that.

The truth of the matter is that the revision hash can only be viewed as final when using hgsubversion after the revision has been pulled from Subversion. Thus, if your developers ever share changesets between Mercurial repositories directly, without Subversion as an intermediary, this will occur. The rebase is automatic and non-optional for a very fundamental reason: Subversion performs that rebase when you push.

If you had unpulled changes when you pushed, Subversion did that rebase for you, and if successful (with a stupidly simple rebasing algorithm) it accepts the commit with no indication that a rebase occurred. We're patching together two different models. I'd recommend moving everyone over to Mercurial at once - a hybrid approach like this is only going to make using Mercurial more difficult in the short term than it needs to be, and potentially confuse users new to DVCS.

I've got a team that would like to switch to hg, but svn rules the wasteland here. If we set up a master hg repo, and only push to/pull from the master svn from there, will everything be ok? Longer version: My boss would be ok with us switching to hg, but only if one team does a pilot program first.

There's enough common code (not to mention the build machine is still running svn) that switching to hg completely is out of the question. – mos May 25 '10 at 19:52 1 @mos: That will work, in fact, it's what I do personally. The trick is to learn the modified hghgsubversionsvn workflow.

Once you "get" how it works, you won't have any trouble. You'll just type a few more commands. I've actually started writing scripts to make the process (which is repetitive) easier.

Typical flow: in "hg" repo commit a bunch of changes; push them to "hgsubversion"; switch to "hgsubversion" hg update (hgsubversion needs this); hg push to "svn" (which automatically re-pulls after you push and removes your changesets locally); ... to be continued ... – Harvey Jun 23 '10 at 21:04 1 @mos: ...switch back to "hg" hg pull from "hgsubversion"; hg strip the older duplicates because "hg" isn't an hgsubversion clone and doesn't know to automatically strip the old changesets – Harvey Jun 23 '10 at 21:04.

First, let me say what a pleasure it was to read such a detailed question write up. :) The problem is happening when you do the hg push to the svn repo from remote. Here's that output from your example: hg push pushing to svn://... searching for changes r3834 bmurphy: database namespace pulled 1 revisions saving bundle to /srv/hg/repository/.

Hg/strip-backup/62539f8df3b2-temp adding branch adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files rebase completed I'm not a hg-subversion user, but that output says that in the process of doing the push you requested, it's pulling the changes from the svn repo, finding a new revision and then doing a rebase of your changeset 10c1 after (descendent of) the newly pulled revision. The rebase command takes branching histories and turns the into linear histories, but in doing so it changes the parents of the changesets, which changes their hashes, which looks like just what's happening to you. Again, not a hg-subversion user, so I can't say if that pull/rebase is always supposed to happen and how that's supposed to work, but the hgsubversion wiki page says: You can use the usual Mercurial commands to work with this repository.

If you have a series of commits on a given branch, and want to move them to the tip of that branch, use the hg rebase --svn command while on the tip of your work, and those changesets will automatically be rebased over top of the new upstream work. Which makes it sound not normally automatic. I couldn't quite tell from your intro, are new changesets still being created in svn, or are they created only in mercurial?

If they're only created in mercurial then one work-around would be to set up a svn-gateway repo on the remote system, and do the push from there, and never pull from that repo back into mercurial. Then the changesets in that repo would have different hashids due to the rebase, but they'd not flow back into the main remote repo and the end user systems. The bigger fix though is to figure out why "hg push svn://.. is rebasing all the outbound changesets".

Answer that one and the behavior will stop.

I tried looking closer at this, but still no luck. I can't find a way to hg push from the intermediate repository without it automatically doing a rebase, and hg rebase --svn doesn't do anything because it is already at the most recent version. – Dalroth Mar 24 '10 at 18:59 Yeah, talk to the hg-subversion guys about why it's doing a rebase and if it can be avoided.

I'm afraid I'm only good for work arounds (which the 3 repo solution does). – Ry4an Mar 25 '10 at 2:01 @Dalroth, @Ry4an: hgsubversion must do the rebase because of quirks with subversion. The ultimate solution would be if hgsubversion could detect when you make an hg clone of an hgsubversion clone.

Then, it would perform the necessary downstream strips and rebases automatically. I use this process now at work. It works, but you have to get used to it.It gets more complicated if your hgsubversion clone is not automatically kept up-to-date with the subversion server (because you have to pull from SVN, and then rebase your changes onto the new tip).

– Harvey Jun 23 '10 at 20:57.

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