bookmarks and branches again: files

Simon King simon at simonking.org.uk
Wed Jul 13 13:03:27 UTC 2016


On Wed, Jul 13, 2016 at 1:37 PM, Uwe Brauer <oub at mat.ucm.es> wrote:
>>>> "Uwe" == Uwe Brauer <oub at mat.ucm.es> writes:
>
>>>> "Simon" == Simon King <simon at simonking.org.uk> writes:
>    >> On Wed, Jul 13, 2016 at 9:18 AM, Uwe Brauer <oub at mat.ucm.es> wrote:
>    >>>
>    >>>
>    >>> > The `hg update` is unnecessary. `hg bookmark book2` creates
>    >>> > book2 on the current revision and makes it the active bookmark.
>
>    > hg log -r "adds('*.*')"
>
>    > which gives me a list of revisions in which I added files, which is helpful.
>
>    > But is there any command which would just list those files, by name and
>    > rev?
>
> Hg manifest --all
>
> Does almost what I want, it gives a list of files, but not the revision
> when they have been added.

"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'

I don't know the template language well enough to know how to put each
filename on a separate line with the revision number alongside, but it
might be possible.

However, I don't really see why knowing the revision in which a file
was *added* is particularly useful. It wouldn't help you retrieve the
latest version of that file, for instance.

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?

Cheers,

Simon



More information about the Mercurial mailing list