[Bug 5276] New: hg files documentation does not match its behaviour ([PATTERN] vs [FILE])

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Fri Jun 24 07:52:14 UTC 2016


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

            Bug ID: 5276
           Summary: hg files documentation does not match its behaviour
                    ([PATTERN] vs [FILE])
           Product: Mercurial
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: mmalcomson.public at gmail.com
                CC: mercurial-devel at selenic.com

`hg files --help`, gives the usage pattern as
hg files [OPTION]... [PATTERN]...

In general, a PATTERN is treated by default (i.e. when there is no preceding
'glob:', 're:' etc) as a shell-style extended glob pattern, as is described in
the documentation from `hg help patterns`.

Here, in hg files the final argument is treated by default as a 'relpath:'
pattern.
This matches other commands like hg status but these other commands give their
usage pattern as
hg status [OPTION]... [FILE]...


e.g., with a repository that has the following files
test1.txt
test2.txt
'test*.txt'

then
hg files 'test*.txt'
just shows the exact match, while other places that have 'PATTERN' as an
argument, like the '--include' option, show all
hg files --include 'test*.txt'


I would just request that the documentation in `hg files --help` be changed,
but the purpose of this command would then make the default a little pointless.
It's unlikely to be useful to pass explicit names on the command line only to
have them echo'd back, which is I guess why the documentation had 'PATTERN'
there in the first place.

If the functionality of the command should be changed to match the current
documentation, just passing the extra argument default='glob' in the call to
scmutil.match() in commands.files() seems to work, but there may be a better
way.

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


More information about the Mercurial-devel mailing list