Some questions concerning daily use

Giorgos Keramidas keramida at ceid.upatras.gr
Fri Nov 7 02:26:26 CST 2008


On Fri, 7 Nov 2008 07:52:09 +0000 (UTC), rubik <rubik at sina.com> wrote:
> Adrian Buehlmann <adrian <at> cadifra.com> writes:
>> Did you try global option "--debug" (see http://www.selenic.com/mercurial/hg.1.html
>> or "hg -v help pull")?
>>
>> Some examples:
>>
>> % hg pull --debug
>> pulling from w:\hg-crew
>> searching for changes
>> examining 9e6d6568bf7a:0ca4f42daed7
>> request 1: 5f201f711932 fe71e5a12a50
>> received 5f201f711932:6788608627c4
>> ....
>> 48 files updated, 0 files merged, 0 files removed, 0 files unresolved
>
> no that much.
> I just want a simple list of the 48 updated(or added,deleted) file
> names .
>
> any simple way ?

The --debug output already includes stuff like:

  ...
  adding tests/test-symlink-basic revisions
  adding tests/test-symlink-basic.out revisions
  adding tests/test-symlink-os-yes-fs-no.py revisions
  adding tests/test-symlink-os-yes-fs-no.py.out revisions
  adding tests/test-symlinks.out revisions
  ...

These are the files that are 'updated' by the pull.  But this is only
the set of files under `.hg/data/store' that were _updated_ by the pull
command.  It doesn't necessarily mean anything "useful" for the file of
a *workspace* area outside of `.hg/data/store'.

For example, if you only have one head (i.e. revision 10) and you pull
changesets that create five more heads, with a variety of common
ancestors between the new heads and revision 10, the files affected by
the changes between each pair of (newhead, 10) may be different for each
value of <newhead>.

You can find out which files are affected between any pair of changesets
*after* the fact of pulling though, by using "hg stat" for those pairs
of changes that are interesting to you.  For example, given the history
of the "crew" repository if Mercurial itself, which contains changes
like these:

  :
  o    7292:7290,7291   1493d1e05ca3   2008-10-29 10:55 -0700   brendan
  |\     hgweb coal/paper: Restore IE compatibility hack
  | |
  | o  7291:7284   5ac779ea7850   2008-10-29 10:55 -0700   brendan
  | |    Backed out changeset a1f8ad3c1821
  | |
  o |  7290   a3871028aacf   2008-10-29 13:37 +0100   adrian
  | |    add test-fncache
  | |
  : :

You can see the files that are affected by the merge shown as change
7292:1493d1e05ca3 from any child changeset to the merge itself:

  $ hg stat --rev a3871028aacf:1493d1e05ca3
  M templates/static/style-coal.css

  $ hg stat --rev 5ac779ea7850:1493d1e05ca3
  M contrib/buildrpm
  M contrib/mercurial.spec
  M hgext/rebase.py
  M mercurial/hgweb/common.py
  M mercurial/hgweb/hgweb_mod.py
  M mercurial/hgweb/webcommands.py
  M tests/test-rebase-collapse
  M tests/test-rebase-collapse.out
  M tests/test-rebase-conflicts
  M tests/test-rebase-conflicts.out
  A tests/test-fncache
  A tests/test-fncache.out

This is an easy way to see that depending on _how_ you look at a merge
changeset, the set of affected files is different.  When you pull, there
is no merge in progress, so Mercurial can't really decide which set of
the two is `canonical' and show you _that_ set only.



More information about the Mercurial mailing list