nonopolarity
nonopolarity

Reputation: 151146

For Mercurial, if I don't commit for 7 days, I can diff all changes made by me, but not if I have ever committed?

I have the habit of diff'ing all the changes I made before pushing to any repo. But I found that if I never commit for that period of development, such as for 5 days, then I can merge with other people's code, do testing, etc, and I can diff or kdiff3 and see all the changes I made, remove any debug code, fix any small things, and then push to the repo.

However, if I ever committed within this 5-day period, then it seems there is no easy way to "show all my changes".

The closest solution I have is:

hg log -u MyUserName -r tip:4322 --style ~/hg-style.txt | sort | uniq | xargs hg vdiff -r 4322

where ~/hg-style.txt is

changeset = "{files}"
file = "{file}\n"

and 4322 is before I start the 5-day development work. Then the above can diff all the files that was changed by me, but it also includes the changes of my teammates if they made changes to those files, and there can be lots of changes too.

Is there any easy solution?

Upvotes: 1

Views: 130

Answers (1)

Ry4an Brase
Ry4an Brase

Reputation: 78350

Let mercurial do the work for you. Use hg outgoing to see what you've commited but not pushed. Use hg outgoing --patch to see the actual diffs for those. Use hg status --rev tip --rev 4322 to get the list of changed files like you're doing above.

And for the love of all things holy commit frequently!

Upvotes: 3

Related Questions