Differences between revisions 2 and 5 (spanning 3 versions)
Revision 2 as of 2008-03-23 23:31:18
Size: 1146
Editor: abuehl
Comment: +links
Revision 5 as of 2008-11-09 23:19:30
Size: 1229
Editor: BrendanCully
Comment: Mention rdiff extension
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
MYTIP=`hg tip --template "rev"` MYTIP=`hg tip --template "{rev}"`
Line 31: Line 31:
This grabs a bundle of incoming changes then overlays the bundle on your current repository (see [:LookingIntoBundles]) 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.
Line 33: Line 33:
c) Or just use RdiffExtension and run `hg diff http://remoterepo`

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.

c) Or just use RdiffExtension and run hg diff http://remoterepo


CategoryTipsAndTricks

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