annotate tests/fixtures/symlinks.sh @ 1029:513f2b607b06

layouts: pull out logic for splitting svn paths into branch and local parts There is a single method on svnmeta that is responsible for both splitting a subversion path into a local component, which specifies a path relative to the mercurial root, and a branch component, which specifies the path to the root of a subversion branch, and translating that branch path into a mercurial branch name. This pulls the logic for doing the path splitting into a layout object method that *only* splits the path, and changes the svnmeta to call the layout objects's localname method to do the subversion branch path to mercurial branch name translation.
author David Schleimer <dschleimer@fb.com>
date Wed, 05 Jun 2013 11:06:34 -0700
parents b37c401b7f92
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
97
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 #!/bin/sh
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2 #
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 # Generate symlinks.svndump
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4 #
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 mkdir temp
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 cd temp
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9 mkdir project-orig
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 cd project-orig
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 mkdir trunk
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 mkdir branches
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 cd ..
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 svnadmin create testrepo
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 svnurl=file://`pwd`/testrepo
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 svn import project-orig $svnurl -m "init project"
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 svn co $svnurl project
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 cd project/trunk
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 echo a > a
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 ln -s a linka
145
b37c401b7f92 hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents: 126
diff changeset
23 ln -s a linka2
97
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 mkdir d
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 ln -s a d/linka
145
b37c401b7f92 hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents: 126
diff changeset
26 svn add a linka linka2 d
97
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 svn ci -m "add symlinks"
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28 # Move symlinks
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 svn mv linka linkaa
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 svn mv d d2
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31 svn commit -m "moving symlinks"
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 # Update symlinks (test "link " prefix vs applydelta)
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
33 echo b > b
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34 rm linkaa
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
35 ln -s b linkaa
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 rm d2/linka
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
37 ln -s b d2/linka
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
38 svn ci -m "update symlinks"
126
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 97
diff changeset
39 # Replace a symlink with a regular file
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 97
diff changeset
40 rm linkaa
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 97
diff changeset
41 echo data > linkaa
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 97
diff changeset
42 svn propdel svn:special linkaa
145
b37c401b7f92 hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents: 126
diff changeset
43 # Replace another symlink with a regular file in another way
b37c401b7f92 hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents: 126
diff changeset
44 # It should mark linka2 as R(eplaced)
b37c401b7f92 hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents: 126
diff changeset
45 svn rm linka2
b37c401b7f92 hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents: 126
diff changeset
46 echo data2 > linka2
b37c401b7f92 hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents: 126
diff changeset
47 svn add linka2
b37c401b7f92 hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents: 126
diff changeset
48 svn propdel svn:special linka2
126
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 97
diff changeset
49 svn rm d2/linka
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 97
diff changeset
50 svn ci -m "undo link"
97
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51 cd ../..
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
52
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
53 svnadmin dump testrepo > ../symlinks.svndump