Commit b7cdb0f8 authored by Jörg Sonnenberger's avatar Jörg Sonnenberger

tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems

BSD-derived systems will use "ls -A" when running as root. Adjust the
test cases to always use the flag and include .hg and related output as
appropiately.

Differential Revision: https://phab.mercurial-scm.org/D8397
parent 28aacddf3af0
......@@ -281,24 +281,36 @@ on clone (and update) with various substitutions:
$ hg clone -q main main2
abort: subrepo path contains illegal component: $SUB
[255]
$ ls main2
$ ls -A main2
.hg
.hgsub
.hgsubstate
$ SUB=sub1 hg clone -q main main3
abort: subrepo path contains illegal component: $SUB
[255]
$ ls main3
$ ls -A main3
.hg
.hgsub
.hgsubstate
$ SUB=sub2 hg clone -q main main4
abort: subrepo path contains illegal component: $SUB
[255]
$ ls main4
$ ls -A main4
.hg
.hgsub
.hgsubstate
on clone empty subrepo into .hg, then pull (and update), which at least fails:
$ SUB=.hg hg clone -qr0 main main5
abort: subrepo path contains illegal component: $SUB
[255]
$ ls main5
$ ls -A main5
.hg
.hgsub
.hgsubstate
$ test -d main5/.hg/.hg
[1]
$ SUB=.hg hg -R main5 pull -u
......@@ -320,7 +332,10 @@ on clone (and update) into .hg, which at least fails:
$ SUB=.hg hg clone -q main main6
abort: subrepo path contains illegal component: $SUB
[255]
$ ls main6
$ ls -A main6
.hg
.hgsub
.hgsubstate
$ cat main6/.hg/hgrc | grep pwned
[1]
......@@ -329,7 +344,10 @@ on clone (and update) into .hg/* subdir:
$ SUB=.hg/foo hg clone -q main main7
abort: subrepo path contains illegal component: $SUB
[255]
$ ls main7
$ ls -A main7
.hg
.hgsub
.hgsubstate
$ test -d main7/.hg/.hg
[1]
......@@ -338,7 +356,10 @@ on clone (and update) into outer tree:
$ SUB=../out-of-tree-write hg clone -q main main8
abort: subrepo path contains illegal component: $SUB
[255]
$ ls main8
$ ls -A main8
.hg
.hgsub
.hgsubstate
on clone (and update) into e.g. $HOME, which doesn't work since subrepo paths
are concatenated prior to variable expansion:
......@@ -346,8 +367,8 @@ are concatenated prior to variable expansion:
$ SUB="$TESTTMP/envvar/fakehome" hg clone -q main main9
abort: subrepo path contains illegal component: $SUB
[255]
$ ls main9 | wc -l
\s*0 (re)
$ ls -A main9 | wc -l
\s*3 (re)
$ ls
main
......@@ -618,7 +639,8 @@ then pull (and update):
$ SUB="$FAKEHOME" hg clone -qr1 main main6
abort: subrepo path contains illegal component: $SUB
[255]
$ ls "$FAKEHOME"
$ ls -A "$FAKEHOME"
.hg
a
$ SUB="$FAKEHOME" hg -R main6 pull -u
pulling from $TESTTMP/envvarsym/main
......@@ -631,7 +653,8 @@ then pull (and update):
.hgsubstate: untracked file differs
abort: untracked files in working directory differ from files in requested revision
[255]
$ ls "$FAKEHOME"
$ ls -A "$FAKEHOME"
.hg
a
on clone only symlink with hg-managed fakehome directory,
......@@ -642,7 +665,8 @@ then pull (and update):
$ touch "$FAKEHOME/a"
$ hg -R "$FAKEHOME" ci -qAm 'add fakehome file'
$ SUB="$FAKEHOME" hg clone -qr0 main main7
$ ls "$FAKEHOME"
$ ls -A "$FAKEHOME"
.hg
a
$ SUB="$FAKEHOME" hg -R main7 pull -uf
pulling from $TESTTMP/envvarsym/main
......@@ -654,7 +678,8 @@ then pull (and update):
new changesets * (glob)
abort: subrepo path contains illegal component: $SUB
[255]
$ ls "$FAKEHOME"
$ ls -A "$FAKEHOME"
.hg
a
$ cd ..
......@@ -698,7 +723,10 @@ on clone (and update):
#else
$ hg clone -q driveletter driveletter2
$ ls driveletter2
$ ls -A driveletter2
.hg
.hgsub
.hgsubstate
X:
#endif
......@@ -2,7 +2,8 @@
$ echo This is file a1 > a
$ hg add a
$ hg commit -m "commit #0"
$ ls
$ ls -A
.hg
a
$ echo This is file b1 > b
$ hg add b
......@@ -12,5 +13,6 @@
B should disappear
$ ls
$ ls -A
.hg
a
......@@ -1097,7 +1097,8 @@ Request to clone a single branch is respected in sharing mode
no changes found
adding remote bookmark bookA
$ ls share-1anowc
$ ls -A share-1anowc
.hg
Test that auto sharing doesn't cause failure of "hg clone local remote"
......
......@@ -292,7 +292,8 @@ Move file in one branch and delete it in another
rebasing 1:472e38d57782 "mv a b"
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/472e38d57782-17d50e29-rebase.hg
$ hg up -q c492ed3c7e35dcd1dc938053b8adf56e2cfbd062
$ ls
$ ls -A
.hg
b
$ cd ..
$ rm -rf repo
......@@ -433,7 +434,8 @@ Move one file and add another file in the same folder in one branch, modify file
rebasing 3:ef716627c70b "mod a" (tip)
merging b and a to b
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/ef716627c70b-24681561-rebase.hg
$ ls
$ ls -A
.hg
b
c
$ cat b
......@@ -470,7 +472,8 @@ Merge test
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -m merge
$ ls
$ ls -A
.hg
b
$ cd ..
$ rm -rf repo
......@@ -505,7 +508,8 @@ Copy and move file
merging b and a to b
merging c and a to c
saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/ef716627c70b-24681561-rebase.hg
$ ls
$ ls -A
.hg
b
c
$ cat b
......@@ -558,7 +562,8 @@ Do a merge commit with many consequent moves in one branch
|/ desc: mod a
o rev: 0, phase: draft
desc: initial
$ ls
$ ls -A
.hg
c
$ cd ..
$ rm -rf repo
......@@ -588,7 +593,8 @@ Test shelve/unshelve
unshelving change 'default'
rebasing shelved changes
merging b and a to b
$ ls
$ ls -A
.hg
b
$ cat b
b
......
......@@ -62,7 +62,8 @@ should merge c into a
merging with 1:d36c0562f908
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
new changeset 3:a323a0c43ec4 merges remote changes with local
$ ls c
$ ls -A c
.hg
a
b
c
......
......@@ -1823,7 +1823,8 @@ Importing with some success and some errors:
$ hg status -c .
C a
C b
$ ls
$ ls -A
.hg
a
a.rej
b
......@@ -1870,7 +1871,8 @@ Importing with zero success:
$ hg status -c .
C a
C b
$ ls
$ ls -A
.hg
a
a.rej
b
......@@ -1919,7 +1921,8 @@ Importing with unknown file:
$ hg status -c .
C a
C b
$ ls
$ ls -A
.hg
a
a.rej
b
......
......@@ -126,7 +126,9 @@ Remove both largefiles and normal files.
Invoking status precommit hook
R large1
R normal1
$ ls
$ ls -A
.hg
.hglf
sub
$ echo "testlargefile" > large1-test
$ hg add --large large1-test
......@@ -254,7 +256,8 @@ archiving.
$ cat sub/large2
large22
$ cd ../archive2
$ ls
$ ls -A
.hg_archival.txt
sub
$ cat sub/normal2
normal22
......
......@@ -28,7 +28,8 @@ Make a narrow clone then archive it
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
The clone directory should only contain f1 and f2
$ ls -1 narrowclone1 | sort
$ ls -A -1 narrowclone1 | sort
.hg
f1
f2
......
......@@ -54,7 +54,8 @@ Cloning a specific file when stream clone is supported
transferred * KB in * seconds (* */sec) (glob)
$ cd narrow
$ ls
$ ls -A
.hg
$ hg tracked
I path:dir/src/F10
......
......@@ -180,7 +180,8 @@ narrow clone no paths at all
$ hg tracked
$ hg update
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ ls
$ ls -A
.hg
$ cd ..
......
......@@ -26,7 +26,8 @@ narrow clone a couple files, f2 and f8
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd narrow
$ ls
$ ls -A
.hg
f2
f8
$ cat f2 f8
......
......@@ -46,7 +46,8 @@ narrow clone the inside file
$ cd narrow
$ hg tracked
I path:inside
$ ls
$ ls -A
.hg
inside
$ cat inside/f
inside
......
......@@ -55,7 +55,8 @@ widen from an empty clone
added 0 changesets with 1 changes to 1 files
$ hg tracked
I path:inside
$ ls
$ ls -A
.hg
inside
$ cat inside/f
inside
......
......@@ -51,7 +51,8 @@ narrow clone the inside file
$ cd narrow
$ hg tracked
I path:inside
$ ls
$ ls -A
.hg
inside
$ cat inside/f
inside
......
......@@ -25,7 +25,9 @@ delete an empty directory
empty_dir
$ hg purge -v
removing directory empty_dir
$ ls
$ ls -A
.hg
.hgignore
directory
r1
......@@ -41,7 +43,9 @@ delete an untracked directory
removing file untracked_dir/untracked_file1
removing file untracked_dir/untracked_file2
removing directory untracked_dir
$ ls
$ ls -A
.hg
.hgignore
directory
r1
......@@ -61,7 +65,9 @@ delete an untracked file
$ hg purge -v
removing file untracked_file
removing file untracked_file_readonly
$ ls
$ ls -A
.hg
.hgignore
directory
r1
......@@ -72,7 +78,9 @@ delete an untracked file in a tracked directory
directory/untracked_file
$ hg purge -v
removing file directory/untracked_file
$ ls
$ ls -A
.hg
.hgignore
directory
r1
......@@ -84,7 +92,9 @@ delete nested directories
$ hg purge -v
removing directory untracked_directory/nested_directory
removing directory untracked_directory
$ ls
$ ls -A
.hg
.hgignore
directory
r1
......@@ -98,7 +108,9 @@ delete nested directories from a subdir
removing directory untracked_directory/nested_directory
removing directory untracked_directory
$ cd ..
$ ls
$ ls -A
.hg
.hgignore
directory
r1
......@@ -113,7 +125,9 @@ delete only part of the tree
removing directory untracked_directory/nested_directory
removing directory untracked_directory
$ cd ..
$ ls
$ ls -A
.hg
.hgignore
directory
r1
$ ls directory/untracked_file
......@@ -135,7 +149,9 @@ skip ignored files if -i or --all not specified
ignored
$ hg purge -v -i
removing file ignored
$ ls
$ ls -A
.hg
.hgignore
directory
r1
untracked_file
......@@ -189,7 +205,9 @@ skip excluded files
$ touch excluded_file
$ hg purge -p -X excluded_file
$ hg purge -v -X excluded_file
$ ls
$ ls -A
.hg
.hgignore
directory
excluded_file
r1
......@@ -201,7 +219,9 @@ skip files in excluded dirs
$ touch excluded_dir/file
$ hg purge -p -X excluded_dir
$ hg purge -v -X excluded_dir
$ ls
$ ls -A
.hg
.hgignore
directory
excluded_dir
r1
......@@ -214,7 +234,9 @@ skip excluded empty dirs
$ mkdir excluded_dir
$ hg purge -p -X excluded_dir
$ hg purge -v -X excluded_dir
$ ls
$ ls -A
.hg
.hgignore
directory
excluded_dir
r1
......@@ -241,7 +263,9 @@ only remove files
$ hg purge -v --files
removing file dir/untracked_file
removing file untracked_file
$ ls
$ ls -A
.hg
.hgignore
dir
empty_dir
$ ls dir
......@@ -254,7 +278,9 @@ only remove dirs
empty_dir
$ hg purge -v --dirs
removing directory empty_dir
$ ls
$ ls -A
.hg
.hgignore
dir
untracked_file
$ ls dir
......@@ -273,6 +299,8 @@ remove both files and dirs
removing file untracked_file
removing directory empty_dir
removing directory dir
$ ls
$ ls -A
.hg
.hgignore
$ cd ..
......@@ -121,7 +121,8 @@
# unbundle
$ clearcache
$ ls
$ ls -A
.hg
w
x
y
......
......@@ -475,14 +475,16 @@ Prompt before undeleting file(issue6008)
> EOF
add back removed file a (Yn)? y
undeleting a
$ ls
$ ls -A
.hg
a
$ hg rm a
$ hg revert -i<<EOF
> n
> EOF
add back removed file a (Yn)? n
$ ls
$ ls -A
.hg
$ hg revert -a
undeleting a
$ cd ..
......
......@@ -24,6 +24,7 @@ Should show unknown and b removed
Should show a and unknown
$ ls
$ ls -A
.hg
a
unknown
......@@ -73,7 +73,8 @@ revert deletion (! status) of a added file
$ hg status b
b: * (glob)
$ ls
$ ls -A
.hg
a
c
e
......
......@@ -1249,7 +1249,8 @@ Abort unshelve while merging (issue5123)
record change 2/2 to 'd'?
(enter ? for help) [Ynesfdaq?] n
$ ls
$ ls -A
.hg
b
c
e
......@@ -1284,7 +1285,8 @@ Abort unshelve while merging (issue5123)
$ hg status -v
A c
A d
$ ls
$ ls -A
.hg
b
c
d
......
......@@ -28,10 +28,12 @@ test sparse
Clear rules when there are includes
$ hg debugsparse --include *.py
$ ls
$ ls -A
.hg
data.py
$ hg debugsparse --clear-rules
$ ls
$ ls -A
.hg
base.sparse
data.py
index.html
......@@ -41,12 +43,14 @@ Clear rules when there are includes
Clear rules when there are excludes
$ hg debugsparse --exclude *.sparse
$ ls
$ ls -A
.hg
data.py
index.html
readme.txt
$ hg debugsparse --clear-rules
$ ls
$ ls -A
.hg
base.sparse
data.py
index.html
......@@ -56,18 +60,21 @@ Clear rules when there are excludes
Clearing rules should not alter profiles
$ hg debugsparse --enable-profile webpage.sparse
$ ls
$ ls -A
.hg
base.sparse
index.html
webpage.sparse
$ hg debugsparse --include *.py
$ ls
$ ls -A
.hg
base.sparse
data.py
index.html
webpage.sparse
$ hg debugsparse --clear-rules
$ ls
$ ls -A
.hg
base.sparse
index.html
webpage.sparse
......@@ -34,7 +34,8 @@ Verify local clone with a sparse profile works