we are switching from subversion to mercurial now. something is different to them. so I record some hints here how we change our daily software development work.
* in subverion, we usually to merge one changeset. but in mercurial, it is not the same thing.
* if the changeset is on different branch, we can merge the two branch. that means merge thsi changeset. :) totally different to subversion, ha. we can't only merge this changeset, we have to merge the two branch. but don't worry about the old changesets on the branch, mercurial is very smart to recognize the old same changesets , so it won't make conflicts. the command like this: hg merge xxx(the branch name of the changeset which you want to merge), of course the current branch should be the branch you are working on.
* if the changeset is on one of ancient branch, you can only use the rebase to do this merge. that means rebase one parent from the new changeset. something like this: hg rebase -s (the revision number which you want to merge) -d (the target branch you want to merge, or let's say the branch you are working on)
* if we have some uncommitted changes on the working directly, we can't do merge stuff, because mercurial forbidden to do this, that means he need a clean working directory. then how we can clean those uncommitted changes?
* if they are really some uncommitted changes you do, then just do this command: hg revert --all.
* if they are some uncommitted merge, then you can do hg revert to clean them, seems it is boring how to abort the uncommitted merge. I have a trick to do this: hg update -C. the -C option will clean the working directory.
* if you have some local commits which you don't want to push, you can use hg strip to delete them from you local working directory.
so that's it, have fun and enjoy the mercurial.
* in subverion, we usually to merge one changeset. but in mercurial, it is not the same thing.
* if the changeset is on different branch, we can merge the two branch. that means merge thsi changeset. :) totally different to subversion, ha. we can't only merge this changeset, we have to merge the two branch. but don't worry about the old changesets on the branch, mercurial is very smart to recognize the old same changesets , so it won't make conflicts. the command like this: hg merge xxx(the branch name of the changeset which you want to merge), of course the current branch should be the branch you are working on.
* if the changeset is on one of ancient branch, you can only use the rebase to do this merge. that means rebase one parent from the new changeset. something like this: hg rebase -s (the revision number which you want to merge) -d (the target branch you want to merge, or let's say the branch you are working on)
* if we have some uncommitted changes on the working directly, we can't do merge stuff, because mercurial forbidden to do this, that means he need a clean working directory. then how we can clean those uncommitted changes?
* if they are really some uncommitted changes you do, then just do this command: hg revert --all.
* if they are some uncommitted merge, then you can do hg revert to clean them, seems it is boring how to abort the uncommitted merge. I have a trick to do this: hg update -C. the -C option will clean the working directory.
* if you have some local commits which you don't want to push, you can use hg strip to delete them from you local working directory.
so that's it, have fun and enjoy the mercurial.
No comments:
Post a Comment