diff --exclude format
Matthew Watson
mattw.watson at gmail.com
Thu Jun 3 05:40:56 UTC 2010
Thanks for the pointer to that obvious doco I overlooked!
path: would be even better, but it seems to drop trailing '/'s
hg diff -r 0 .hgignore --exclude path:.hgignore/
return nothing, whereas
hg diff .hgignore -r 0 --exclude 're:\.hgignore/.*'
gives me what I want: the diff for .hgignore only.
If a path was a dir but got removed and a file created with the same
name, I don't want to know about all the files in the dir, just the
diff for the exact path match.
FYI: this is for atlassian FishEye interrogating the repo.
Matt
On 3 June 2010 12:53, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, 2010-06-03 at 12:48 +1000, Matthew Watson wrote:
>> Hi Guys,
>>
>> I'm trying to write and extension and I'm calling commands.diff and
>> I'm passing a --exclude option. I'm trying to figure out from the doco
>> what the format of this "pattern" is: Seems to variously take shell
>> type globs or regexps with varying results.
>>
>> OK, so I can't find doco really, so I looked through the source. Seems
>> the best way is to specify what it is by saying:
>>
>> --exclude "re:regexp"
>> or
>> --exclude "glob:shellglob"
>>
>> Is the only doco for this to be got by reading _patsplit in mercurial/match.py??
>
> hg help patterns
>
>> FYI: I' trying to cope with weird file names that may have regex/glob
>> shars in them, so was calling re.escape(path), but this produce
>> "\.hgignore" for input of ".hgignore" which isn't good on windows
>> because the glob format thinks this is a path separator (works fine on
>> mac though). Finally figured out I should prepend "re:" and treat the
>> whole as a regexp.
>
> path:
>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
>
More information about the Mercurial-devel
mailing list