3

Before pulling from the central repositiry, I usually use the 'hg incoming' command to see what I will be pulling. However, this only gives me a list of changesets with some comments, and not a list of the actual files that have been modified.

1) In such a situation, how can I get a list of modified files (including some basic info about the chane, like Removed, Moved, etc)?

2) Similarly, when I do an 'hg status', I get the differences between my local working copy and what is currently on the repository. However, a more useful feature would be to get the differences between what is incoming and my local working copy. How can I get this?

Thanks!

elesser
  • 135
  • 4

2 Answers2

3

1/ Most options are presented in "how to see files in repository before running 'update'":

hg incoming --stat

Notes:

  • For remote repository, using --bundle avoids downloading the changesets twice if the incoming is followed by a pull.
  • --stat: output diffstat-style summary of changes.
    (ie: Statistics of changes with the following format: "modified files: +added/-removed lines")

2/ See RDiff extension (and the SO question "Using Mercurial, is there an easy way to diff my working copy with the tip file in the default remote repository")

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • The --stat option is not recognized by my version of Mercurial. Is this option available from the native product or does it require any add-ons? Thanks. – elesser Nov 29 '10 at 11:59
  • @elesser: no it should be a native command. Its may be linked to Hg1.6: http://mercurial.selenic.com/wiki/WhatsNew#A1.6_.282010-07-01.29 from last July: see this patch http://www.selenic.com/pipermail/mercurial-devel/2010-April/020816.html (which is about `log`, but also `incoming` options) – VonC Nov 29 '10 at 12:04
1

If you don't have a recent enough version for --stat, you can get a similar overview using status:

cd repo

// grab the newest changes into a bundle
hg incoming --bundle morechanges.bun

// get an id for the current tip
hg tip
  changeset: x:abcdef
  ...

// see what's changed by overlaying the bundle on the repo
hg -R morechanges.bun status --rev abcdef:tip
  //info you're looking for

// everything's good; add the bundle to the repo
hg pull morechanges.bun

rm morechanges.bun
anton.burger
  • 5,637
  • 32
  • 48