Show More
@@ -28,9 +28,13 b'' | |||
|
28 | 28 | |
|
29 | 29 | set -euo pipefail |
|
30 | 30 | |
|
31 | printusage () { | |
|
32 | echo "usage: `basename $0` REPO NBHEADS DEPTH [left|right]" >&2 | |
|
33 | } | |
|
34 | ||
|
31 | 35 | if [ $# -lt 3 ]; then |
|
32 | echo "usage: `basename $0` REPO NBHEADS DEPTH" | |
|
33 |
|
|
|
36 | printusage | |
|
37 | exit 64 | |
|
34 | 38 | fi |
|
35 | 39 | |
|
36 | 40 | repo="$1" |
@@ -42,6 +46,24 b' shift' | |||
|
42 | 46 | depth="$1" |
|
43 | 47 | shift |
|
44 | 48 | |
|
49 | doleft=1 | |
|
50 | doright=1 | |
|
51 | if [ $# -gt 1 ]; then | |
|
52 | printusage | |
|
53 | exit 64 | |
|
54 | elif [ $# -eq 1 ]; then | |
|
55 | if [ "$1" == "left" ]; then | |
|
56 | doleft=1 | |
|
57 | doright=0 | |
|
58 | elif [ "$1" == "right" ]; then | |
|
59 | doleft=0 | |
|
60 | doright=1 | |
|
61 | else | |
|
62 | printusage | |
|
63 | exit 64 | |
|
64 | fi | |
|
65 | fi | |
|
66 | ||
|
45 | 67 | leftrepo="${repo}-${nbheads}h-${depth}d-left" |
|
46 | 68 | rightrepo="${repo}-${nbheads}h-${depth}d-right" |
|
47 | 69 | |
@@ -52,17 +74,25 b' leftsubset="ancestors($left, $depth) and' | |||
|
52 | 74 | rightsubset="ancestors($right, $depth) and only($right, heads(all() - $right))" |
|
53 | 75 | |
|
54 | 76 | echo '### creating left/right repositories with missing changesets:' |
|
55 | echo '# left revset:' '"'${leftsubset}'"' | |
|
56 |
echo '# |
|
|
77 | if [ $doleft -eq 1 ]; then | |
|
78 | echo '# left revset:' '"'${leftsubset}'"' | |
|
79 | fi | |
|
80 | if [ $doright -eq 1 ]; then | |
|
81 | echo '# right revset:' '"'${rightsubset}'"' | |
|
82 | fi | |
|
57 | 83 | |
|
58 | echo '### building left repository:' $left-repo | |
|
59 | echo '# cloning' | |
|
60 | hg clone --noupdate "${repo}" "${leftrepo}" | |
|
61 | echo '# stripping' '"'${leftsubset}'"' | |
|
62 | hg -R "${leftrepo}" --config extensions.strip= strip --rev "$leftsubset" --no-backup | |
|
84 | if [ $doleft -eq 1 ]; then | |
|
85 | echo '### building left repository:' $left-repo | |
|
86 | echo '# cloning' | |
|
87 | hg clone --noupdate "${repo}" "${leftrepo}" | |
|
88 | echo '# stripping' '"'${leftsubset}'"' | |
|
89 | hg -R "${leftrepo}" --config extensions.strip= strip --rev "$leftsubset" --no-backup | |
|
90 | fi | |
|
63 | 91 | |
|
64 | echo '### building right repository:' $right-repo | |
|
65 | echo '# cloning' | |
|
66 | hg clone --noupdate "${repo}" "${rightrepo}" | |
|
67 | echo '# stripping:' '"'${rightsubset}'"' | |
|
68 | hg -R "${rightrepo}" --config extensions.strip= strip --rev "$rightsubset" --no-backup | |
|
92 | if [ $doright -eq 1 ]; then | |
|
93 | echo '### building right repository:' $right-repo | |
|
94 | echo '# cloning' | |
|
95 | hg clone --noupdate "${repo}" "${rightrepo}" | |
|
96 | echo '# stripping:' '"'${rightsubset}'"' | |
|
97 | hg -R "${rightrepo}" --config extensions.strip= strip --rev "$rightsubset" --no-backup | |
|
98 | fi |
General Comments 0
You need to be logged in to leave comments.
Login now