Mercurial > hg
annotate tests/svn/svndump-move.sh @ 23575:a2f139d25845
subrepo: drop the 'ui' parameter to archive()
The current state of subrepo methods is to pass a 'ui' object to some methods,
which has the effect of overriding the subrepo configuration since it is the
root repo's 'ui' that is passed along as deep as there are subrepos. Other
subrepo method are *not* passed the root 'ui', and instead delegate to their
repo object's 'ui'. Even in the former case where the root 'ui' is available,
some methods are inconsistent in their use of both the root 'ui' and the local
repo's 'ui'. (Consider hg._incoming() uses the root 'ui' for path expansion
and some status messages, but also calls bundlerepo.getremotechanges(), which
eventually calls discovery.findcommonincoming(), which calls
setdiscovery.findcommonheads(), which calls status() on the local repo 'ui'.)
This inconsistency with respect to the configured output level is probably
always hidden, because --verbose, --debug and --quiet, along with their 'ui.xxx'
equivalents in the global and user level hgrc files are propagated from the
parent repo to the subrepo via 'baseui'. The 'ui.xxx' settings in the parent
repo hgrc file are not propagated, but that seems like an unusual thing to set
on a per repo config file. Any 'ui.xxx' options changed by --config are also
not propagated, because they are set on repo.ui by dispatch.py, not repo.baseui.
The goal here is to cleanup the subrepo methods by dropping the 'ui' parameter,
which in turn prevents mixing subtly different 'ui' instances on a given subrepo
level. Some methods use more than just the output level settings in 'ui' (add
for example ends up calling scmutil.checkportabilityalert() with both the root
and local repo's 'ui' at different points). This series just goes for the low
hanging fruit and switches methods that only use the output level.
If we really care about not letting a subrepo config override the root repo's
output level, we can propagate the verbose, debug and quiet settings to the
subrepo in the same way 'ui.commitsubrepos' is in hgsubrepo.__init__.
Archive only uses the 'ui' object to call its progress() method, and gitsubrepo
calls status().
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 13 Dec 2014 14:53:46 -0500 |
parents | 55abde5cba43 |
children |
rev | line source |
---|---|
7475
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 #!/bin/sh |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 # |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 # Use this script to generate move.svndump |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 # |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 mkdir temp |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 cd temp |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 mkdir project-orig |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 cd project-orig |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 mkdir trunk |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 echo a > trunk/a |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 mkdir trunk/d1 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 mkdir trunk/d2 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 echo b > trunk/d1/b |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 echo c > trunk/d1/c |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 echo d > trunk/d2/d |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 cd .. |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 svnadmin create svn-repo |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 svnurl=file://`pwd`/svn-repo |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 svn import project-orig $svnurl -m "init projA" |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 svn co $svnurl project |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 cd project |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 # Build a module renaming chain which used to confuse the converter. |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 # Update svn repository |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 echo a >> trunk/a |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 echo c >> trunk/d1/c |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 svn ci -m commitbeforemove |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 svn up |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 mkdir subproject/trunk |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 svn add subproject/trunk |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 svn ci -m createtrunk |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 mkdir subproject/branches |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 svn add subproject/branches |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 svn ci -m createbranches |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 svn up |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 echo b >> subproject/trunk/d1/b |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
43 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
44 svn rm subproject/trunk/d2 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
45 svn ci -m "changeb and rm d2" |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
46 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
47 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
48 if svn help copy | grep 'SRC\[@REV\]' > /dev/null 2>&1; then |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
49 # SVN >= 1.5 replaced the -r REV syntax with @REV |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
50 # Copy a file from a past revision |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 svn copy $svnurl/subproject/trunk/d2/d@7 $svnurl/subproject/trunk -m copyfilefrompast |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
52 # Copy a directory from a past revision |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
53 svn copy $svnurl/subproject/trunk/d2@7 $svnurl/subproject/trunk -m copydirfrompast |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
54 else |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 # Copy a file from a past revision |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
56 svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
57 # Copy a directory from a past revision |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
58 svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
59 fi |
8884
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
60 |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
61 # Copy a directory while removing a subdirectory |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
62 svn up |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
63 mkdir -p subproject/trunk/d3/d31 |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
64 echo e > subproject/trunk/d3/d31/e |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
65 echo f > subproject/trunk/d3/f |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
66 svn add subproject/trunk/d3 |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
67 svn ci -m "add d3" |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
68 svn copy subproject/trunk/d3 subproject/trunk/d4 |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
69 svn rm subproject/trunk/d3/d31 |
8b603c7c808e
convert/svn: remove dead code from entry deletion code path
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
70 svn ci -m "copy dir and remove subdir" |
11124
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
71 |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
72 # Test directory moves |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
73 svn up |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
74 mkdir -p subproject/trunk/d4old |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
75 echo g > subproject/trunk/d4old/g |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
76 svn add subproject/trunk/d4old |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
77 svn ci -m "add d4old" |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
78 svn mv subproject/trunk/d4old subproject/trunk/d4new |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
79 svn ci -m "rename d4old into d4new" |
55abde5cba43
test-convert-svn-move: test moved dirs copy records
Patrick Mezard <pmezard@gmail.com>
parents:
8884
diff
changeset
|
80 |
7475
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
81 cd .. |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
82 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
83 svnadmin dump svn-repo > ../move.svndump |