diff branches

Matt Mackall mpm at selenic.com
Tue Dec 19 08:10:46 CST 2006


On Tue, Dec 19, 2006 at 08:51:57AM +0100, Thomas Arendsen Hein wrote:
> * Bryan Murdock <bmurdock at gmail.com> [20061219 00:33]:
> > On 12/18/06, Thomas Arendsen Hein <thomas at intevation.de> wrote:
> > >WHat you can do now is:
> > >hg clone repo1 foo
> > >cd foo
> > >hg pull ../repo2
> > >hg diff -rtip
> > 
> > Ahhh, of course.  I've read the man pages and scoured the wiki and it
> > does seem like creating a branch is the solution (or, workaround) to a
> > lot of problems.
> 
> cloning/branching is _the_ central thing in Mercurial, not just a
> workaround.
> 
> > The one thing I wonder is how long creating a branch
> > takes for a really big project, especially if repo1 in this example is
> > on another machine?
> 
> If repo1 is on another machine, swap repo1 and repo2.
> 
> To speed up everything a little, you can clone the repository
> without creating a working copy, but then you have to manually
> remember the changeset you want to compare to:
> 
> hg clone -U local-repo foo  # takes few seconds and needs nearly no disk space
> cd foo
> hg tip -q
> (prints e.g. 3898:93e5f07baf75)
> hg pull ../remote-repo
> hg diff -r3898 -rtip
> 
> Or using a little bit black magic instead of human brain:
> hg clone -U local-repo foo  # takes few seconds and needs nearly no disk space
> cd foo
> hg debugsetparents tip
> hg pull ../remote-repo
> hg diff -r. -rtip
> (if you plan to use the working directory of this repo, you need to
>  type 'hg debugsetparents null' before using 'hg update'!)
> 
> In both cases you can do
>  cd ../local-repo
>  hg pull -u ../foo
> to pull the remote changes into your local repo without needing to
> transfer them again.
> 
> I think similar things can be done using 'hg incoming' with the
> --bundle option and them using hg diff -R bundlefile while being in
> the local repo, but I haven't tested this.

hg in -q --bundle tmp.hg
hg -R tmp.hg diff -r `hg tip --template {rev}` -r tip
rm tmp.hg

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list