Mercurial > evolve
annotate docs/tutorial/prepare.sh @ 4299:4af0235e7b0b
split: take file patterns to limit selection on matching file patterns
When splitting a big changeset, the user often wants to extract specific files
from the changeset while leaving the others files intact.
The split command can now be called with multiple file patterns. Only files
that match one of the patterns will be shown in the interactive selection. The
user will be able to create one or more commits with those files.
When the user finishes splitting the matching files, a last commit will be
made with the remaining of the files.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 21 Feb 2018 14:39:48 +0100 |
parents | aad37ffd7d58 |
children |
rev | line source |
---|---|
3376
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
1 #!/bin/bash |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
2 set -euo pipefail |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
3 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
4 # Prepare pandoc filters |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
5 if [ -d pandocfilters/.git ]; then |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
6 (cd pandocfilters && git remote update && git merge --ff-only) |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
7 else |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
8 git clone https://github.com/Lothiraldan/pandocfilters.git |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
9 fi |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
10 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
11 pip2 install pandocfilters |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
12 pip2 install pygraphviz |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
13 pip2 install panflute |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
14 pip2 install hg+https://bitbucket.org/octobus/mercurial_docgraph |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
15 pip2 install hg-evolve |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
16 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
17 mkdir -p graphs output |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
18 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
19 CMD_NOT_FOUND=0 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
20 check_command() { |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
21 cmd=$1 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
22 if ! which "$cmd" >/dev/null 2>&1; then |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
23 echo "Error: command '$cmd' not found in \$PATH" |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
24 echo "Please install '$cmd'" |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
25 CMD_NOT_FOUND=1 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
26 else |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
27 echo "$cmd command was found" |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
28 fi |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
29 } |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
30 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
31 check_command pandoc |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
32 check_command aha |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
33 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
34 if [ "$CMD_NOT_FOUND" -ne "0" ]; then |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
35 exit 1 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
36 fi |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
37 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
38 # Prepare directory for repositories generated by the training.t file |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
39 mkdir -p base-repos |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
40 |
aad37ffd7d58
doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
41 rm -Rf base-repos/* |