help with use case
Thomas Arendsen Hein
thomas at intevation.de
Tue Dec 20 07:41:54 UTC 2005
* Faheem Mitha <faheem at email.unc.edu> [20051220 07:29]:
> On Mon, 19 Dec 2005, Bryan O'Sullivan wrote:
> >On Tue, 2005-12-20 at 03:36 +0000, Faheem Mitha wrote:
> >>>Or more complicated, but without a separate repo:
> >>>hg co `hg -R ../source -q tip|cut -d: -f2`
> >>
> >>I'm not sure what magic is being done here. Can you elaborate on this
> >>a little more?
> >
> >This says "check out the revision that is tip in ../source".
>
> Ok. Don't recognize the syntax, though. What's with the
>
> -q tip|cut -d: -f2
This is a pipe. "hg tip -q" prints something like
"1594:a329e0fda2ae", so we want to do "hg co a329e0fda2ae". The cut
command filters the second field (-f2) with the field delimiter set
to ":" (-d:) and the backticks (`) replace the long pipe with its
output.
So you could simply type "hg -R ../source -q tip", look at the
output, and manually type "hg co a329e0fda2ae" (or hg co 1594) to
get the same result, but you wanted an automated way :)
Thomas
--
Email: thomas at intevation.de
http://intevation.de/~thomas/
More information about the Mercurial
mailing list