2012-06-11 03:38:32 +04:00
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
2010-09-10 21:41:45 +04:00
|
|
|
$ echo 0 > a
|
|
|
|
$ echo 0 > b
|
|
|
|
$ echo 0 > t.h
|
|
|
|
$ mkdir t
|
|
|
|
$ echo 0 > t/x
|
|
|
|
$ echo 0 > t/b
|
|
|
|
$ echo 0 > t/e.h
|
|
|
|
$ mkdir dir.h
|
|
|
|
$ echo 0 > dir.h/foo
|
|
|
|
|
|
|
|
$ hg ci -A -m m
|
|
|
|
adding a
|
|
|
|
adding b
|
|
|
|
adding dir.h/foo
|
|
|
|
adding t.h
|
|
|
|
adding t/b
|
|
|
|
adding t/e.h
|
|
|
|
adding t/x
|
|
|
|
|
|
|
|
$ touch nottracked
|
|
|
|
|
2010-09-22 01:00:02 +04:00
|
|
|
$ hg locate a
|
2010-09-10 21:41:45 +04:00
|
|
|
a
|
|
|
|
|
2010-09-22 01:00:02 +04:00
|
|
|
$ hg locate NONEXISTENT
|
|
|
|
[1]
|
2010-09-10 21:41:45 +04:00
|
|
|
|
|
|
|
$ hg locate
|
|
|
|
a
|
|
|
|
b
|
|
|
|
dir.h/foo
|
|
|
|
t.h
|
|
|
|
t/b
|
|
|
|
t/e.h
|
|
|
|
t/x
|
|
|
|
|
|
|
|
$ hg rm a
|
|
|
|
$ hg ci -m m
|
|
|
|
|
|
|
|
$ hg locate a
|
2010-09-17 02:51:32 +04:00
|
|
|
[1]
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate NONEXISTENT
|
2010-09-17 02:51:32 +04:00
|
|
|
[1]
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate relpath:NONEXISTENT
|
2010-09-17 02:51:32 +04:00
|
|
|
[1]
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate
|
|
|
|
b
|
|
|
|
dir.h/foo
|
|
|
|
t.h
|
|
|
|
t/b
|
|
|
|
t/e.h
|
|
|
|
t/x
|
|
|
|
$ hg locate -r 0 a
|
|
|
|
a
|
|
|
|
$ hg locate -r 0 NONEXISTENT
|
2010-09-17 02:51:32 +04:00
|
|
|
[1]
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate -r 0 relpath:NONEXISTENT
|
2010-09-17 02:51:32 +04:00
|
|
|
[1]
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate -r 0
|
|
|
|
a
|
|
|
|
b
|
|
|
|
dir.h/foo
|
|
|
|
t.h
|
|
|
|
t/b
|
|
|
|
t/e.h
|
|
|
|
t/x
|
|
|
|
|
|
|
|
-I/-X with relative path should work:
|
|
|
|
|
|
|
|
$ cd t
|
|
|
|
$ hg locate
|
|
|
|
b
|
|
|
|
dir.h/foo
|
|
|
|
t.h
|
|
|
|
t/b
|
|
|
|
t/e.h
|
|
|
|
t/x
|
|
|
|
$ hg locate -I ../t
|
|
|
|
t/b
|
|
|
|
t/e.h
|
|
|
|
t/x
|
|
|
|
|
2010-09-24 12:13:49 +04:00
|
|
|
Issue294: hg remove --after dir fails when dir.* also exists
|
2010-09-10 21:41:45 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ rm -r t
|
|
|
|
|
2014-10-01 02:45:48 +04:00
|
|
|
$ hg rm t/b
|
|
|
|
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate 't/**'
|
2017-12-11 06:50:57 +03:00
|
|
|
t/b
|
|
|
|
t/e.h
|
|
|
|
t/x
|
2010-09-10 21:41:45 +04:00
|
|
|
|
2014-09-13 03:32:46 +04:00
|
|
|
$ hg files
|
|
|
|
b
|
2017-12-11 06:50:57 +03:00
|
|
|
dir.h/foo
|
2014-09-13 03:32:46 +04:00
|
|
|
t.h
|
2017-12-11 06:50:57 +03:00
|
|
|
t/e.h
|
|
|
|
t/x
|
2014-09-13 03:32:46 +04:00
|
|
|
$ hg files b
|
|
|
|
b
|
|
|
|
|
2010-09-10 21:41:45 +04:00
|
|
|
$ mkdir otherdir
|
|
|
|
$ cd otherdir
|
|
|
|
|
2015-06-21 02:59:26 +03:00
|
|
|
$ hg files path:
|
2017-12-11 06:50:57 +03:00
|
|
|
../b
|
|
|
|
../dir.h/foo
|
|
|
|
../t.h
|
|
|
|
../t/e.h
|
|
|
|
../t/x
|
2015-06-21 02:59:26 +03:00
|
|
|
$ hg files path:.
|
2017-12-11 06:50:57 +03:00
|
|
|
../b
|
|
|
|
../dir.h/foo
|
|
|
|
../t.h
|
|
|
|
../t/e.h
|
|
|
|
../t/x
|
2015-06-21 02:59:26 +03:00
|
|
|
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate b
|
2017-12-11 06:50:57 +03:00
|
|
|
../b
|
|
|
|
../t/b
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate '*.h'
|
2017-12-11 06:50:57 +03:00
|
|
|
../t.h
|
|
|
|
../t/e.h
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate path:t/x
|
2017-12-11 06:50:57 +03:00
|
|
|
../t/x
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate 're:.*\.h$'
|
2017-12-11 06:50:57 +03:00
|
|
|
../t.h
|
|
|
|
../t/e.h
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate -r 0 b
|
2017-12-11 06:50:57 +03:00
|
|
|
../b
|
|
|
|
../t/b
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate -r 0 '*.h'
|
2017-12-11 06:50:57 +03:00
|
|
|
../t.h
|
|
|
|
../t/e.h
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate -r 0 path:t/x
|
2017-12-11 06:50:57 +03:00
|
|
|
../t/x
|
2010-09-10 21:41:45 +04:00
|
|
|
$ hg locate -r 0 're:.*\.h$'
|
2017-12-11 06:50:57 +03:00
|
|
|
../t.h
|
|
|
|
../t/e.h
|
2010-09-10 21:41:45 +04:00
|
|
|
|
2014-09-13 03:36:38 +04:00
|
|
|
$ hg files
|
2017-12-11 06:50:57 +03:00
|
|
|
../b
|
|
|
|
../dir.h/foo
|
|
|
|
../t.h
|
|
|
|
../t/e.h
|
|
|
|
../t/x
|
2014-09-13 03:36:38 +04:00
|
|
|
$ hg files .
|
|
|
|
[1]
|
|
|
|
|
2017-10-21 11:19:02 +03:00
|
|
|
Convert native path separator to slash (issue5572)
|
|
|
|
|
|
|
|
$ hg files -T '{path|slashpath}\n'
|
|
|
|
../b
|
|
|
|
../dir.h/foo
|
|
|
|
../t.h
|
|
|
|
../t/e.h
|
|
|
|
../t/x
|
|
|
|
|
2012-06-11 03:38:32 +04:00
|
|
|
$ cd ../..
|