##// END OF EJS Templates
tests: make and use a new `svnurlof.py` helper for constructing svn urls...
Augie Fackler -
r41518:41bd254b default draft
parent child Browse files
Show More
@@ -0,0 +1,17 b''
1 import sys
2
3 from mercurial import (
4 pycompat,
5 util,
6 )
7
8 def main(argv):
9 enc = util.urlreq.quote(pycompat.sysbytes(argv[1]))
10 if pycompat.iswindows:
11 fmt = 'file:///%s'
12 else:
13 fmt = 'file://%s'
14 print(fmt % pycompat.sysstr(enc))
15
16 if __name__ == '__main__':
17 main(sys.argv)
@@ -11,11 +11,7 b''
11 > EOF
11 > EOF
12
12
13 $ SVNREPOPATH=`pwd`/svn-repo
13 $ SVNREPOPATH=`pwd`/svn-repo
14 #if windows
14 $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`"
15 $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
16 #else
17 $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
18 #endif
19
15
20 $ svnadmin create "$SVNREPOPATH"
16 $ svnadmin create "$SVNREPOPATH"
21 $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF
17 $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF
@@ -8,11 +8,7 b''
8 $ svnadmin create svn-repo
8 $ svnadmin create svn-repo
9 $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump"
9 $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump"
10 $ SVNREPOPATH=`pwd`/svn-repo
10 $ SVNREPOPATH=`pwd`/svn-repo
11 #if windows
11 $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`"
12 $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
13 #else
14 $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
15 #endif
16
12
17 Convert trunk and branches
13 Convert trunk and branches
18
14
@@ -13,11 +13,7 b''
13
13
14 $ svnadmin create svn-repo
14 $ svnadmin create svn-repo
15 $ SVNREPOPATH=`pwd`/svn-repo
15 $ SVNREPOPATH=`pwd`/svn-repo
16 #if windows
16 $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`"
17 $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
18 #else
19 $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
20 #endif
21 $ INVALIDREVISIONID=svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1
17 $ INVALIDREVISIONID=svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1
22 $ VALIDREVISIONID=svn:a2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk/mytrunk@1
18 $ VALIDREVISIONID=svn:a2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk/mytrunk@1
23
19
@@ -23,18 +23,7 b' handle svn subrepos safely'
23 $ svnadmin create svn-repo-2499
23 $ svnadmin create svn-repo-2499
24
24
25 $ SVNREPOPATH=`pwd`/svn-repo-2499/project
25 $ SVNREPOPATH=`pwd`/svn-repo-2499/project
26
26 $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`"
27 #if py3
28 $ pathquoted=`"$PYTHON" -c "import sys, urllib.parse; sys.stdout.write(urllib.parse.quote(sys.argv[1]))" "$SVNREPOPATH"`
29 #else
30 $ pathquoted=`"$PYTHON" -c "import sys, urllib; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
31 #endif
32
33 #if windows
34 $ SVNREPOURL=file:///$pathquoted
35 #else
36 $ SVNREPOURL=file://$pathquoted
37 #endif
38
27
39 $ mkdir -p svn-project-2499/trunk
28 $ mkdir -p svn-project-2499/trunk
40 $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL"
29 $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL"
@@ -1,11 +1,7 b''
1 #require svn15
1 #require svn15
2
2
3 $ SVNREPOPATH=`pwd`/svn-repo
3 $ SVNREPOPATH=`pwd`/svn-repo
4 #if windows
4 $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`"
5 $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
6 #else
7 $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
8 #endif
9
5
10 $ filter_svn_output () {
6 $ filter_svn_output () {
11 > egrep -v 'Committing|Transmitting|Updating|(^$)' || true
7 > egrep -v 'Committing|Transmitting|Updating|(^$)' || true
General Comments 0
You need to be logged in to leave comments. Login now