Syntactic Fructose
Syntactic Fructose

Reputation: 20134

How to view changes in a recent push to the repository

I have a group of three friends working on programming a game engine, so we have a ton of code to look over. Sometimes one of us might accidentally modify a piece of code and forget to tell the other about, leading to some confusion later on in the code.

How can i look at the changes that were made specifically to the code when a new push is made to the repository? I enjoyed working with SVN's patch for an open source project that would show you what you directly modified and send over to the mod who would implement it into the application. How would i do something like this along hg's lines?

Upvotes: 1

Views: 71

Answers (1)

mrucci
mrucci

Reputation: 4470

How can i look at the changes that were made specifically to the code when a new push is made to the repository?

The --patch switch for the hg log command is a quick way to review patches from the command line.

If you want to export a patch to a file, use the hg export command. For example, with:

hg export -r-2 -o file.patch

you are saving the second to last commit into the file named: file.patch. You can now share the file and anybody can import the patch with:

hg import file.patch

This command will also create a commit with the same message as the original exported commit, unless the --no-commit switch is used.

Upvotes: 1

Related Questions