##// END OF EJS Templates
convert: fix test-convert-svn-* problems with mtime not changing...
Peter Arrenbrecht -
r6439:c1b47c0f default
parent child Browse files
Show More
@@ -0,0 +1,25 b''
1 #!/usr/bin/env python
2
3 __doc__ = """Same as `echo a >> b`, but ensures a changed mtime of b.
4 Without this svn will not detect workspace changes."""
5
6 import sys, os
7
8 text = sys.argv[1]
9 fname = sys.argv[2]
10
11 f = open(fname, "ab")
12 try:
13 before = os.fstat(f.fileno()).st_mtime
14 f.write(text)
15 f.write("\n")
16 finally:
17 f.close()
18 inc = 1
19 now = os.stat(fname).st_mtime
20 while now == before:
21 t = now + inc
22 inc += 1
23 os.utime(fname, (t, t))
24 now = os.stat(fname).st_mtime
25
@@ -48,25 +48,25 b' svn ci -m "branch trunk, remove letter3"'
48 svn up
48 svn up
49
49
50 echo % update trunk
50 echo % update trunk
51 echo "what can I say ?" >> trunk/letter.txt
51 "$TESTDIR/svn-safe-append.py" "what can I say ?" trunk/letter.txt
52 svn ci -m "change letter"
52 svn ci -m "change letter"
53
53
54 echo % update old branch
54 echo % update old branch
55 echo "what's up ?" >> branches/old/letter2.txt
55 "$TESTDIR/svn-safe-append.py" "what's up ?" branches/old/letter2.txt
56 svn ci -m "change letter2"
56 svn ci -m "change letter2"
57
57
58 echo % create a cross-branch revision
58 echo % create a cross-branch revision
59 svn move -m "move letter2" trunk/letter2.txt \
59 svn move -m "move letter2" trunk/letter2.txt \
60 branches/old/letter3.txt
60 branches/old/letter3.txt
61 echo "I am fine" >> branches/old/letter3.txt
61 "$TESTDIR/svn-safe-append.py" "I am fine" branches/old/letter3.txt
62 svn ci -m "move and update letter3.txt"
62 svn ci -m "move and update letter3.txt"
63
63
64 echo % update old branch again
64 echo % update old branch again
65 echo "bye" >> branches/old/letter2.txt
65 "$TESTDIR/svn-safe-append.py" "bye" branches/old/letter2.txt
66 svn ci -m "change letter2 again"
66 svn ci -m "change letter2 again"
67
67
68 echo % update trunk again
68 echo % update trunk again
69 echo "how are you ?" >> trunk/letter.txt
69 "$TESTDIR/svn-safe-append.py" "how are you ?" trunk/letter.txt
70 svn ci -m "last change to letter"
70 svn ci -m "last change to letter"
71 cd ..
71 cd ..
72
72
@@ -38,8 +38,8 b' svn import -m "init projA" projA $svnurl'
38 echo % update svn repository
38 echo % update svn repository
39 svn co $svnurl A | fix_path
39 svn co $svnurl A | fix_path
40 cd A
40 cd A
41 echo a >> trunk/a
41 "$TESTDIR/svn-safe-append.py" a trunk/a
42 echo c >> trunk/d1/c
42 "$TESTDIR/svn-safe-append.py" c trunk/d1/c
43 svn ci -m commitbeforemove
43 svn ci -m commitbeforemove
44 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
44 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
45 svn up
45 svn up
@@ -51,7 +51,7 b' svn add subproject/branches'
51 svn ci -m createbranches
51 svn ci -m createbranches
52 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
52 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
53 svn up
53 svn up
54 echo b >> subproject/trunk/d1/b
54 "$TESTDIR/svn-safe-append.py" b subproject/trunk/d1/b
55 svn ci -m changeb
55 svn ci -m changeb
56 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
56 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
57 cd ..
57 cd ..
@@ -32,7 +32,7 b' echo b > a/d1/d2/b'
32 echo % add
32 echo % add
33 hg --cwd a ci -d '0 0' -A -m 'add a file'
33 hg --cwd a ci -d '0 0' -A -m 'add a file'
34
34
35 echo a >> a/a
35 "$TESTDIR/svn-safe-append.py" a a/a
36 echo % modify
36 echo % modify
37 hg --cwd a ci -d '1 0' -m 'modify a file'
37 hg --cwd a ci -d '1 0' -m 'modify a file'
38 hg --cwd a tip -q
38 hg --cwd a tip -q
@@ -107,21 +107,21 b' hg init b'
107 echo base > b/b
107 echo base > b/b
108 hg --cwd b ci -d '0 0' -Ambase
108 hg --cwd b ci -d '0 0' -Ambase
109
109
110 echo left-1 >> b/b
110 "$TESTDIR/svn-safe-append.py" left-1 b/b
111 echo left-1 > b/left-1
111 echo left-1 > b/left-1
112 hg --cwd b ci -d '1 0' -Amleft-1
112 hg --cwd b ci -d '1 0' -Amleft-1
113
113
114 echo left-2 >> b/b
114 "$TESTDIR/svn-safe-append.py" left-2 b/b
115 echo left-2 > b/left-2
115 echo left-2 > b/left-2
116 hg --cwd b ci -d '2 0' -Amleft-2
116 hg --cwd b ci -d '2 0' -Amleft-2
117
117
118 hg --cwd b up 0
118 hg --cwd b up 0
119
119
120 echo right-1 >> b/b
120 "$TESTDIR/svn-safe-append.py" right-1 b/b
121 echo right-1 > b/right-1
121 echo right-1 > b/right-1
122 hg --cwd b ci -d '3 0' -Amright-1
122 hg --cwd b ci -d '3 0' -Amright-1
123
123
124 echo right-2 >> b/b
124 "$TESTDIR/svn-safe-append.py" right-2 b/b
125 echo right-2 > b/right-2
125 echo right-2 > b/right-2
126 hg --cwd b ci -d '4 0' -Amright-2
126 hg --cwd b ci -d '4 0' -Amright-2
127
127
@@ -41,12 +41,12 b' echo hello > letter.txt'
41 svn add letter.txt
41 svn add letter.txt
42 svn ci -m hello
42 svn ci -m hello
43
43
44 echo world >> letter.txt
44 "$TESTDIR/svn-safe-append.py" world letter.txt
45 svn ci -m world
45 svn ci -m world
46
46
47 svn copy -m "tag v0.1" $svnurl/trunk $svnurl/tags/v0.1
47 svn copy -m "tag v0.1" $svnurl/trunk $svnurl/tags/v0.1
48
48
49 echo 'nice day today!' >> letter.txt
49 "$TESTDIR/svn-safe-append.py" 'nice day today!' letter.txt
50 svn ci -m "nice day"
50 svn ci -m "nice day"
51 cd ..
51 cd ..
52
52
@@ -55,14 +55,14 b' hg convert $svnurl B-hg'
55
55
56 echo % update svn repository again
56 echo % update svn repository again
57 cd B
57 cd B
58 echo "see second letter" >> letter.txt
58 "$TESTDIR/svn-safe-append.py" "see second letter" letter.txt
59 echo "nice to meet you" > letter2.txt
59 echo "nice to meet you" > letter2.txt
60 svn add letter2.txt
60 svn add letter2.txt
61 svn ci -m "second letter"
61 svn ci -m "second letter"
62
62
63 svn copy -m "tag v0.2" $svnurl/trunk $svnurl/tags/v0.2
63 svn copy -m "tag v0.2" $svnurl/trunk $svnurl/tags/v0.2
64
64
65 echo "blah-blah-blah" >> letter2.txt
65 "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt
66 svn ci -m "work in progress"
66 svn ci -m "work in progress"
67 cd ..
67 cd ..
68
68
@@ -42,16 +42,16 b' svn ci -m createab'
42 svn rm trunk/b
42 svn rm trunk/b
43 svn ci -m removeb
43 svn ci -m removeb
44 svn up
44 svn up
45 echo a >> trunk/a
45 "$TESTDIR/svn-safe-append.py" a trunk/a
46 svn ci -m changeaa
46 svn ci -m changeaa
47
47
48 echo % branch
48 echo % branch
49 svn up
49 svn up
50 svn copy trunk branches/branch1
50 svn copy trunk branches/branch1
51 echo a >> branches/branch1/a
51 "$TESTDIR/svn-safe-append.py" a branches/branch1/a
52 svn ci -m "branch, changeaaa"
52 svn ci -m "branch, changeaaa"
53
53
54 echo a >> branches/branch1/a
54 "$TESTDIR/svn-safe-append.py" a branches/branch1/a
55 echo c > branches/branch1/c
55 echo c > branches/branch1/c
56 svn add branches/branch1/c
56 svn add branches/branch1/c
57 svn ci -m "addc,changeaaaa"
57 svn ci -m "addc,changeaaaa"
@@ -39,13 +39,13 b' cd A'
39 echo a > trunk/a
39 echo a > trunk/a
40 svn add trunk/a
40 svn add trunk/a
41 svn ci -m adda
41 svn ci -m adda
42 echo a >> trunk/a
42 "$TESTDIR/svn-safe-append.py" a trunk/a
43 svn ci -m changea
43 svn ci -m changea
44 echo a >> trunk/a
44 "$TESTDIR/svn-safe-append.py" a trunk/a
45 svn ci -m changea2
45 svn ci -m changea2
46 # Add an unrelated commit to test that tags are bound to the
46 # Add an unrelated commit to test that tags are bound to the
47 # correct "from" revision and not a dummy one
47 # correct "from" revision and not a dummy one
48 echo a >> unrelated/dummy
48 "$TESTDIR/svn-safe-append.py" a unrelated/dummy
49 svn add unrelated/dummy
49 svn add unrelated/dummy
50 svn ci -m unrelatedchange
50 svn ci -m unrelatedchange
51 echo % tag current revision
51 echo % tag current revision
@@ -53,7 +53,7 b' svn up'
53 svn copy trunk tags/trunk.v1
53 svn copy trunk tags/trunk.v1
54 svn copy trunk tags/trunk.badtag
54 svn copy trunk tags/trunk.badtag
55 svn ci -m "tagging trunk.v1 trunk.badtag"
55 svn ci -m "tagging trunk.v1 trunk.badtag"
56 echo a >> trunk/a
56 "$TESTDIR/svn-safe-append.py" a trunk/a
57 svn ci -m changea3
57 svn ci -m changea3
58 echo % fix the bad tag
58 echo % fix the bad tag
59 # trunk.badtag should not show in converted tags
59 # trunk.badtag should not show in converted tags
General Comments 0
You need to be logged in to leave comments. Login now