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

            Bug ID: 6886
           Summary: hg grep from a subdirectory shows paths relative to
                    repo root, not subdirectory
           Product: Mercurial
           Version: 6.7.4
          Hardware: PC
                OS: NetBSD
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzi...@mercurial-scm.org
          Reporter: mercurial-bugzi...@campbell.mumble.net
                CC: mercurial-de...@mercurial-scm.org
    Python Version: ---

Given a repository with some matching test in a file in a subdirectory:

$ hg init
$ mkdir foo bar
$ echo hello >foo/baz
$ echo hello >bar/quux
$ hg add foo bar
adding bar/quux
adding foo/baz
$ hg commit -m mumble

hg grep always shows paths relative to the repository root, even if run from
within the subdirectory and restricted to that one:

$ hg grep hello .
bar/quux:hello
foo/baz:hello
$ cd foo
$ hg grep hello .
foo/baz:hello

Desired output:

$ hg grep hello .
bar/quux:hello
foo/baz:hello
$ cd foo
$ hg grep hello .
baz:hello

This better matches the behaviour of grep (and git grep), e.g. the output can
be piped to another program that operates on the listed files without having to
cd to the repo root first.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@lists.mercurial-scm.org
https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to