ivan.ukr
ivan.ukr

Reputation: 3581

How to include files only of certain type into hg diff output

I have hg repo on Windows PC with some changesets. Say between changesets 100 and 101 changes introduced into few .cpp .h and .sql files in multiple subdirectories. Is there a way to produce diff (using plain hg diff) which included only .cpp and *.h files? I was trying following:

1) This one produced me full diff including .sql files:

hg diff -r 100 -r 101 -X *.sql

2) This one produced me empty diff:

hg diff -r 100 -r 101 *.cpp *.h

Any ideas?

UPD: Was reading this http://hgbook.red-bean.com/read/file-names-and-pattern-matching.html Did not help.

Upvotes: 4

Views: 1329

Answers (2)

Lazy Badger
Lazy Badger

Reputation: 97375

HG-way will be hg diff ... "set:**.cpp + **.h"

Upvotes: 3

ivan.ukr
ivan.ukr

Reputation: 3581

Following command helped:

 hg diff -r 100 -r 101 -I glob:**.cpp glob:**.h

Upvotes: 4

Related Questions