tests/test-mq-subrepo-svn.t
author Gregory Szorc <gregory.szorc@gmail.com>
Wed, 23 Jan 2019 17:57:43 -0800
changeset 41330 d5c58d679ed9
parent 39707 5abc47d4ca6b
child 41480 eb6700e6c5ea
permissions -rw-r--r--
tests: support URL quoting on Python 3 We could use mercurial.urllibcompat, but meh. This makes things easier to read. The test still fails on Python 3 for some reason. But at least we no longer have an exception. Differential Revision: https://phab.mercurial-scm.org/D5669
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
34987
846942fd6d15 subrepo: disable git and svn subrepos by default (BC) (SEC)
Yuya Nishihara <yuya@tcha.org>
parents: 33365
diff changeset
     8
  > [subrepos]
34989
1a314176da9c subrepo: use per-type config options to enable subrepos
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34987
diff changeset
     9
  > allowed = true
1a314176da9c subrepo: use per-type config options to enable subrepos
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34987
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
41330
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    26
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    27
#if py3
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    28
  $ pathquoted=`"$PYTHON" -c "import sys, urllib.parse; sys.stdout.write(urllib.parse.quote(sys.argv[1]))" "$SVNREPOPATH"`
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    29
#else
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    30
  $ pathquoted=`"$PYTHON" -c "import sys, urllib; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    31
#endif
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    32
17033
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    33
#if windows
41330
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    34
  $ SVNREPOURL=file:///$pathquoted
17033
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    35
#else
41330
d5c58d679ed9 tests: support URL quoting on Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    36
  $ SVNREPOURL=file://$pathquoted
17033
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    37
#endif
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    38
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    39
  $ mkdir -p svn-project-2499/trunk
26374
048e41e9a6ac tests: suppress verbose output of svn transaction
Yuya Nishihara <yuya@tcha.org>
parents: 24471
diff changeset
    40
  $ 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
    41
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    42
qnew on repo w/svn subrepo
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    43
  $ mkrepo repo-2499-svn-subrepo
17033
0413f68da85c tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    44
  $ svn co "$SVNREPOURL"/trunk sub
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    45
  Checked out revision 1.
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    46
  $ echo 'sub = [svn]sub' >> .hgsub
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    47
  $ hg add .hgsub
13410
1f2b2c33d386 tests: fixes for svn 1.4.2
Matt Mackall <mpm@selenic.com>
parents: 13326
diff changeset
    48
  $ hg status -S -X '**/format'
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    49
  A .hgsub
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    50
  $ hg qnew -m0 0.diff
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    51
  $ cd sub
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    52
  $ echo a > a
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    53
  $ svn add a
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    54
  A         a
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    55
  $ svn st
13410
1f2b2c33d386 tests: fixes for svn 1.4.2
Matt Mackall <mpm@selenic.com>
parents: 13326
diff changeset
    56
  A*    a (glob)
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    57
  $ cd ..
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    58
  $ 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
    59
  $ 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
    60
  abort: uncommitted changes in subrepository "sub"
13300
23bbb5b888ea subrepo: separate out mq+svn subrepo tests
Kevin Bullock <kbullock@ringworld.org>
parents:
diff changeset
    61
  [255]
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16894
diff changeset
    62
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16894
diff changeset
    63
  $ cd ..