tests/test-mq-subrepo-svn.t
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 16 Oct 2024 18:06:36 -0400
branchstable
changeset 51697 e760a36a6013
parent 49449 075a553028e2
permissions -rw-r--r--
windows: implement `util.cachestat` to fix numerous dirstate problems I got here by bisecting the issue1790 related failure on Windows to keep an entry from being marked "unset" in `test-dirstate.t` back to eedbf8256263. There were a handful of other tests failing with an unexpected dirstate entry state like this, as well as numerous "skip updating dirstate: identity mismatch" messages added to various tests, as well as an issue with dirstate wrapping with the largefiles extension[1], all of which appear to be fixed by this. In total, ~25 tests are fully fixed on Windows with this change on default. This is basically a copy/paste of the posix implementation, but we drop the `st_mode` comparison- I think the only reason we care about the mode on posix is to detect +/-x mode changes, but the executable bits on Windows are synthesized based on the name of the file[2]. None of the other parts of the codebase are equipped to handle executable bits in the filesystem on Windows anyway, so it doesn't make sense to worry about them here. Note that `st_uid` and `st_gid` seem to always be 0 on Windows (and I can't find them being initialized), so they can probably be dropped from the comparison. But I doubt they matter any more on posix, since we don't track ownership. The `st_ino`, `st_dev`, and `st_nlink` attributes all seem to have reasonable values for comparing like on posix[3]. Also note that `st_ctime` is apparently deprecated in 3.12+ (for reasons I haven't explored)[4]. [1] https://foss.heptapod.net/mercurial/mercurial-devel/-/merge_requests/884 [2] https://github.com/python/cpython/blob/aab3210271136ad8e8fecd927b806602c463e1f2/Modules/posixmodule.c#L1948 [3] https://github.com/python/cpython/blob/aab3210271136ad8e8fecd927b806602c463e1f2/Python/fileutils.c#L1158 [4] https://github.com/python/cpython/blob/aab3210271136ad8e8fecd927b806602c463e1f2/Modules/posixmodule.c#L2200
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 17033
diff changeset
     1
#require svn13
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
     2
23172
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     3
  $ cat <<EOF >> $HGRCPATH
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     4
  > [extensions]
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     5
  > mq =
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     6
  > [diff]
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     7
  > nodates = 1
34965
846942fd6d15 subrepo: disable git and svn subrepos by default (BC) (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 33365
diff changeset
     8
  > [subrepos]
34967
1a314176da9c subrepo: use per-type config options to enable subrepos
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34965
diff changeset
     9
  > allowed = true
1a314176da9c subrepo: use per-type config options to enable subrepos
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34965
diff changeset
    10
  > svn:allowed = true
23172
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
    11
  > EOF
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    12
13326
535a891284da test-subrepo-mq-svn.t: correct comment
Kevin Bullock <kbullock@ringworld.org>
parents: 13300
diff changeset
    13
fn to create new repository, and cd into it
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    14
  $ mkrepo() {
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    15
  >     hg init $1
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    16
  >     cd $1
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    17
  >     hg qinit
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    18
  > }
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    19
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    20
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    21
handle svn subrepos safely
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    22
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    23
  $ svnadmin create svn-repo-2499
17033
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    24
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    25
  $ SVNREPOPATH=`pwd`/svn-repo-2499/project
41510
e095a9688a31 tests: quote $PYTHON for py3 support on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 41494
diff changeset
    26
  $ SVNREPOURL="`"$PYTHON" $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`"
17033
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    27
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    28
  $ mkdir -p svn-project-2499/trunk
26374
048e41e9a6ac tests: suppress verbose output of svn transaction
Yuya Nishihara <yuya@tcha.org>
parents: 24471
diff changeset
    29
  $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL"
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    30
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    31
qnew on repo w/svn subrepo
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    32
  $ mkrepo repo-2499-svn-subrepo
17033
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    33
  $ svn co "$SVNREPOURL"/trunk sub
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    34
  Checked out revision 1.
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    35
  $ echo 'sub = [svn]sub' >> .hgsub
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    36
  $ hg add .hgsub
13410
1f2b2c33d386 tests: fixes for svn 1.4.2
Matt Mackall <mpm@selenic.com>
parents: 13326
diff changeset
    37
  $ hg status -S -X '**/format'
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    38
  A .hgsub
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    39
  $ hg qnew -m0 0.diff
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    40
  $ cd sub
49449
075a553028e2 tests: work around libmagic bug in svn subrepo tests
Arun Kulshreshtha <akulshreshtha@janestreet.com>
parents: 41510
diff changeset
    41
  $ echo foo > a
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    42
  $ svn add a
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    43
  A         a
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    44
  $ svn st
13410
1f2b2c33d386 tests: fixes for svn 1.4.2
Matt Mackall <mpm@selenic.com>
parents: 13326
diff changeset
    45
  A*    a (glob)
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    46
  $ cd ..
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    47
  $ hg status -S        # doesn't show status for svn subrepos (yet)
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    48
  $ hg qnew -m1 1.diff
33365
6d88468d435b subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents: 26374
diff changeset
    49
  abort: uncommitted changes in subrepository "sub"
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    50
  [255]
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16894
diff changeset
    51
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16894
diff changeset
    52
  $ cd ..