Mercurial > public > mercurial-scm > hg
diff tests/test-audit-subrepo.t @ 44724:5c2a4f37eace
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
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Fri, 10 Apr 2020 19:58:34 +0200 |
parents | a62690659d6b |
children | 9dc1351d0b5f |
line wrap: on
line diff
--- a/tests/test-audit-subrepo.t Fri Apr 10 19:53:36 2020 +0200 +++ b/tests/test-audit-subrepo.t Fri Apr 10 19:58:34 2020 +0200 @@ -281,24 +281,36 @@ $ 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 @@ $ 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 @@ $ 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 @@ $ 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 @@ $ 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 @@ $ 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 @@ .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 @@ $ 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 @@ new changesets * (glob) abort: subrepo path contains illegal component: $SUB [255] - $ ls "$FAKEHOME" + $ ls -A "$FAKEHOME" + .hg a $ cd .. @@ -698,7 +723,10 @@ #else $ hg clone -q driveletter driveletter2 - $ ls driveletter2 + $ ls -A driveletter2 + .hg + .hgsub + .hgsubstate X: #endif