[PATCH] commands: New option for 'hg identify', to allow explicit output of long hash

Simon Howkins simonh at symbian.org
Mon Jun 7 05:08:19 CDT 2010


(Thanks for all the speedy feedback.)

The use case is related to hg id by wanting to run

hg id -I -r <BRANCH> http://blah.com/repo

--debug adds unhelpful debugging of the http connection
hg log won't work on a remote repo
hg parents also

The overall use case is scripting to tag a release on a dedicated "TAGS"
branch, rather than the default branch; but without having to pull all the
code into a local repository. Find the long hash, and make the update to the
.hgtags file directly.

Another way to do it would be with

hg tag -r 123456789012345678901234567890234567890
--just-do-it-even-if-you-cant-find-that-node-in-this-repo

But the extension to hg id seemed a more reasonable approach.

Simon
-- 
Simon Howkins
Integration
Symbian Foundation
London
+44 (0) 7763 102 896


On 4 June 2010 20:19, Thomas Arendsen Hein <thomas at intevation.de> wrote:

> * Steve Borho <steve at borho.org> [20100604 20:28]:
> > On Fri, Jun 4, 2010 at 1:01 PM, Matt Mackall <mpm at selenic.com> wrote:
> > > On Fri, 2010-06-04 at 16:41 +0100, Simon Howkins wrote:
> > >> # HG changeset patch
> > >> # User Simon Howkins <simonh at symbian.org>
> > >> # Date 1275642988 -3600
> > >> # Branch stable
> > >> # Node ID 6a39deac68b5a8bee88de5e18fc2a9f436be3fdf
> > >> # Parent  d3ebb1a0bc49559e1e41d37f69c2afa06722563e
> > >> commands: New option for 'hg identify', to allow explicit output of
> long hash
> > >
> > > $ hg id -i --debug -r .
> > > 9f7ea411f54e1527008315861a8c04eac0748f6a
> >
> > I think there's some general hesitation from using --debug in scripts
> > from fear the output format may be less stable than a normal command.
> >
> > Though in this particular case, using log with a template is an
> > adequate workaround.
>
> hg parents --template '{node}\n'
>
> would be the easiest, but in case of local changes you have to
> manually calculate the "+" or in case of merges above line will
> print two lines instead of one.
>
> Simon, what is the use case of getting a long hash here?
>
> Regards,
> Thomas
>
> --
> thomas at intevation.de - http://intevation.de/~thomas/<http://intevation.de/%7Ethomas/>- OpenPGP key: 0x5816791A
> Intevation GmbH, Neuer Graben 17, 49074 Osnabrueck - AG Osnabrueck, HR B
> 18998
> Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
>


Some facts about Symbian that we are legally obliged to tell you: 
Symbian Foundation Limited is a Company Limited by Guarantee and not having Share Capital
We're registered in England and Wales - Companies House knows us by the number 6683783
Our address is 1 Boundary Row, Southwark, London SE1 8HP.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100607/743f955c/attachment.htm>


More information about the Mercurial-devel mailing list