Easiest way to get a diff between repos?

Matt Mackall mpm at selenic.com
Thu Jul 26 10:27:26 CDT 2007


On Thu, Jul 26, 2007 at 04:13:13PM +0200, Gábor Farkas wrote:
> TK Soh wrote:
> > On 7/26/07, Michael Sperber <sperber at informatik.uni-tuebingen.de> wrote:
> >> "TK Soh" <teekaysoh at gmail.com> writes:
> >>
> >>> On 7/26/07, Michael Sperber <sperber at informatik.uni-tuebingen.de> wrote:
> >>>> "TK Soh" <teekaysoh at gmail.com> writes:
> >>>>
> >>>>> On 7/26/07, Michael Sperber <sperber at informatik.uni-tuebingen.de> wrote:
> >>>>>> Subject says all, basically.  I don't want the changesets---just a plain
> >>>>>> old diff.  It'd be nice if that didn't involve creating a clone.
> >>>>> Have you tried the plain old 'diff'?
> >>>> Sorry, I was being unclear: I'd like to compare specific revisions
> >>>> within the repositories.
> >>> hg diff --rev REV1 --rev REV2
> >> OK, but what if REV1 is from repository A and REV2 is from repository B?
> > 
> > Not sure exactly what you have in your repo, but in most cases you
> > should have a good number of common changesets in both repos. Are you
> > trying to compare two mutually excluded  changesets in the two repos?
> 
> 
> wouldn't be enough to simply:
> 
> - clone a copy of repo1
> - clone a copy of repo2
> 
> - update repo1 to REV1
> - update repo2 to REV2
> 
> - delete the .hg directory in repo1
> - delete the .hg directory in repo2
> 
> - do a "diff -r repo1 repo2"

A bit better:

hg clone -U repo1 repo-clone
cd repo-clone
hg pull ../repo2
hg diff -r rev1 -r rev2

An alternative with no temporary directory:

hg in -q --bundle in.hg -r rev2 ../repo2
hg -R in.hg diff -r rev1 -r rev2
rm in.hg

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list