[Bug 5334] New: Cannot specify starting revision for "hg log -f <file>" or "hg log -r follow(file)"

bugzilla at mercurial-scm.org bugzilla at mercurial-scm.org
Thu Aug 18 10:35:18 UTC 2016


https://bz.mercurial-scm.org/show_bug.cgi?id=5334

            Bug ID: 5334
           Summary: Cannot specify starting revision for "hg log -f
                    <file>" or "hg log -r follow(file)"
           Product: Mercurial
           Version: 3.9
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: gabor.stefanik at nng.com
                CC: mercurial-devel at selenic.com

Currently the follow(<file>) revset shows the history of a file or set of files
in the working directory across renames. "hg log -f <file>" does something very
similar as well.
There is no way, however, to likewise show the full history of a file from a
specific revision.

That means, we can do things like:

(only(release, default) + only(default, release)) &
file("conflicting_file.cpp")

to find out who should be responsible for resolving a conflict in
conflicting_file.cpp when merging from release to default - as long as
conflicting_file.cpp has not been renamed on either release or default.

However, we can't do:

(only(release, default) + only(default, release)) &
(follow("conflicting_file.cpp", release) +
follow("renamed_conflicting_file.cpp", default))

to do the same when there is a rename on default.

It should be possible to use follow(<file>) in this way on files in any
revision, without requiring an update to that revision (a potentially
destructive operation if there are uncommitted changes in the working copy).

I propose the following syntax:
Add a 2nd param to the follow() revset, that specifies the starting revision
(using an inner revset) for the file to follow, and defaults to "."

So, follow("file.cpp") gives all revisions changing the file known as file.cpp
in the current working copy, while follow("file.cpp", release) shows all
revisions affecting what's known as "file.cpp" in the current tip of the
release branch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list