Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2008-03-23 15:53:56
Size: 1094
Editor: abuehl
Comment: moved from TipsAndTricks/Intermediate
Revision 4 as of 2008-11-07 15:32:23
Size: 1162
Editor: HolgerJoukl
Comment: Fixed --template argument in the clone method recipee to from "rev" to "{rev}"
Deletions are marked like this. Additions are marked like this.
Line 12: Line 12:
a) The clone method a) The [:Clone:clone] method
Line 17: Line 17:
MYTIP=`hg tip --template "rev"` MYTIP=`hg tip --template "{rev}"`
Line 24: Line 24:
b) The bundle method b) The [:Bundle:bundle] method
Line 31: Line 31:
This grabs a bundle of incoming changes then overlays the bundle on your current repo to generate the diff.
If the diff is agreeable, you can unbundle the repo to make the changes permanent.
This grabs a bundle of incoming changes then overlays the bundle on your current [:Repository:repository] (see [:LookingIntoBundles]) to generate the diff. If the diff is agreeable, you can unbundle the repo to make the changes permanent.

Generate a diff between two Repositories

Usually, you can use the -p option to either incoming or outgoing. Example:

cd /path/to/repo1
hg incoming -p /path/to/repo2

Sometimes you may want a single diff. There are a number of ways to do this. We'll describe two:

a) The [:Clone:clone] method

The basic idea is to use a cheap temporary clone to do the work. If the diff is agreeable, you can then pull from your temporary clone.

MYTIP=`hg tip --template "{rev}"`
hg clone -U . tmp # make a temporary clone with no working directory
hg -R tmp pull http://remoterepo # pull the remote changes into the temporary repo
hg -R tmp diff -r $MYTIP -r tip #
rm -rf tmp

b) The [:Bundle:bundle] method

MYTIP=`hg tip --template "{rev}"`
hg in -q --bundle tmp.hg http://remoterepo && hg -R tmp.hg diff -r $MYTIP -r tip

This grabs a bundle of incoming changes then overlays the bundle on your current [:Repository:repository] (see [:LookingIntoBundles]) to generate the diff. If the diff is agreeable, you can unbundle the repo to make the changes permanent.


CategoryTipsAndTricks

GenerateDiffBetweenRepositories (last edited 2012-11-06 22:44:30 by abuehl)