开发者

Using Mercurial (hg), is there a way to diff rev 4873 and 4821 but only for my changes?

I want to know what changes I made, without looking at the 30 other files that other team members modified.

So when I hg out, it said the first changeset to push was 4821, so since then I have pulled, me开发者_JAVA技巧rged, and pushed a couple times. Now I want to make sure all the debugging code is removed. Is there a way to diff the current revision (4873) against revision 4821 but only for my changes?


If your changes are in different files than those of your coworkers, which is how it sounds, you can use something like this:

hg diff -r 4821 -r 4863 -I path/to/file1 -I path/to/file2

If they're mixed in the same files as other people's changes then you would have needed to keep your changes in a separate branch (which doesn't require the branch command, anonymous branching is commonly used for this sort of thing).


The following command should do the trick:

hg diff -r "4821:4873 and user(your_username)"


I don't know if you can upgrade to the recently release Mercurial 1.6 or not, but this functional query language feature they just put in is what you might be looking for.


Try this approach:

  1. First clone your local repo to another folder
  2. In the new clone, rebase your last changeset so that it immediately follows your the other changeset (this should create a new head from it)
  3. Do the diff
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜