bookmarks and branches again: files
Simon King
simon at simonking.org.uk
Wed Jul 13 13:37:28 UTC 2016
On Wed, Jul 13, 2016 at 2:30 PM, Uwe Brauer <oub at mat.ucm.es> wrote:
>
> > On Wed, Jul 13, 2016 at 1:37 PM, Uwe Brauer <oub at mat.ucm.es> wrote:
>
> > "hg log" uses mercurial's template engine for output, and "file_adds"
> > is a template keyword that produces a list of files added in a
> > particular revision. Here's a messy example:
>
> > hg log -r "adds('.')" --template '{rev} {desc|firstline}\n{file_adds}\n\n'
>
> Very useful, thanks
I did a bit more experimenting, and this is closer to what you asked for:
hg log -r "adds('.')" --template '{rev} {join(file_adds, "\n{rev} ")}\n'
>
> > I think I'm confused about how you actually use mercurial, and how you
> > are wanting to use branches or bookmarks. Perhaps if you gave us some
> > more detail there we would be able to make better suggestions?
>
> 2 scenarios: my own repositories: for example the notes of my courses,
> for each year I use a new branch. I am happy with this approach and I
> have not encountered any problems.
>
> However I have also to maintain matlab mode for emacs, which dwells in
> sourceforge and in github. These are under git control and I use the hg
> plugin to access them. So far I have not used any branching but if I
> would, I should use bookmarks.
>
> Bookmarks however frighten me for the reason that on can accidentally
> delete them. So my question were mostly academic I wanted to see the
> dangers of bookmarks and how to encounter them.
>
OK, in this situation, you are using bookmarks to give names to what
would otherwise be anonymous heads in your repository. The "hg heads"
command (or alternatively "hg log -r 'heads(all())'") will display all
the heads, and presumably by looking through those you would be able
to find the revision you were looking for.
Simon
More information about the Mercurial
mailing list