开发者

How do I push only my first X local commits to SVN using hgsubversion?

开发者 https://www.devze.com 2023-02-27 03:44 出处:网络
I\'m currently using hgsubversion on a project to enjoy the benefits of local commits while the project\'s official SCM is Subversion. In order to push local commits to the SVN repo, I\'ve been using

I'm currently using hgsubversion on a project to enjoy the benefits of local commits while the project's official SCM is Subversion. In order to push local commits to the SVN repo, I've been using hg rebase --svn followed by a simple hg push with successful results thus far.

One small hiccup I've run into is that if I have a certain fix for something that I'd like to push, without pushing everything else, I thought I could just commit that fix and then push it. But this gives me the following message:

abort: outstanding uncommitted changes

OK, fine. So I shelve my uncommitted changes. B开发者_高级运维ut for some reason, I'm unable to shelve one particular change (added a new file). I figure, what the heck, I can just commit this as it won't really do any harm.

So that's what I do. But then I see that hg push can take an -r flag which, according to the help documentation, has this effect:

If -r/--rev is used, the specified revision and all its ancestors will be pushed to the remote repository.

Great! So that sounds like exactly what I want. Now say my latest two local commits are given revision numbers 94 and 95. I thought I could do hg push -r 94 and only push the first commit to SVN while the second remains a pure local commit. But for some reason this pushed both 94 and 95.

What did I do wrong?


Assuming you have the mq extension enabled:

hg qimport -r95:
hg qpop -a
hg push
hg qpush -a


I am not too familiar with Hg, but this is what you can do:

hg up -r 94
hg rebase --svn
hg push --svn
0

精彩评论

暂无评论...
验证码 换一张
取 消