[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial
Subject:    Re: tip: getting the files which might be affected by a merge
From:       "Steve (Gadget) Barnes" <gadgetsteve () hotmail ! com>
Date:       2015-09-07 16:37:44
Message-ID: BLU436-SMTP221955604EDE3BD3D72AE68AA540 () phx ! gbl
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



On 07/09/2015 14:57, Arne Babenhauserheide wrote:
> Hi,
> 
> A collegue asked me how to get all the files which could be affected by a merge. \
> With some help from killerix and Anoia in #mercurial and "set operations in the \
> unix shell" (http://www.catonmat.net/blog/set-operations-in-unix-shell-simplified/), \
> I came up with this clean solution: 
> hg diff -r "ancestor(.,other) -r . --stat | cut -d "|" -f 1 | sed "s/ *$//" > \
> /tmp/1 hg diff -r "ancestor(.,other) -r other --stat | cut -d "|" -f 1 | sed "s/ \
> *$//" > /tmp/2 comm -12 <(sort /tmp/1) <(sort /tmp/2)
> 
> I thought it could be interesting for others, too :)
> 
> Best wishes,
> Arne
> 
> PS: I also addid it to the wiki:
> https://mercurial.selenic.com/wiki/TipsAndTricks#list_files_which_might_be_affected_by_a_merge
>  
> --
> A man in the streets faces a knife.
> Two policemen are there it once. They raise a sign:
> 
> "Illegal Scene! Noone may watch this!"
> 
> The man gets robbed and stabbed and bleeds to death.
> The police had to hold the sign.
> 
> …Welcome to Europe, citizen. Censorship is beautiful.
> 
> ( http://draketo.de/stichwort/censorship )
> 
> 
> 
> 
> _______________________________________________
> Mercurial mailing list
> Mercurial@selenic.com
> https://selenic.com/mailman/listinfo/mercurial
> 

You can get the same sort of effect, without the unix magic, by using
changesets and templates:

e.g.:

	hg log -r ::otherrev - ::thisrev --template={rev}:{node|short} Changes:
{join(files, ", ")}"

Which will list out, for each revision that is a member of ancestors of
otherrev that are not ancestors of thisrev, the rev number and the
impacted files.

I have used this to great effect.

Gadget/Steve
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJV7b1YAAoJEPv0ETl4DpztDToIAKVVPTLgyLzCvDlFiY/RkJ25
kZQ2vDsCu4nI5xaDA/uDGROvtPbD6atvtYfD4QKhUByvBc9YiecbHp8NMcVo7OPJ
EyUgrjWto6NfTXVB71IOzgVEgKvJNJMduCkvMvedxqTs7XlmSnHWO/u/7m08hIWN
gWgIqNModl9KrfG/mY5WK26xEBgoOGHig2w4xNd9Af+LOD4NJklUoe3NeXP003wI
4l6qAwN+wMNHpNkbGx6jINmYkvnYX1XF668Xsv2CR1b6Y8BsA3KbVoLopIOYnnZY
YEKTuWJEjIc7Dsx2isamUDzVsry6GU9ijpXDAjb8rNTVe0D/OhkR5SLd3KQOsoo=
=G/Qh
-----END PGP SIGNATURE-----
_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
https://selenic.com/mailman/listinfo/mercurial


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic