Oben Sonne avatar Oben Sonne committed 491e282

Just a snapshot ...

Comments (0)

Files changed (4)

 syntax: regexp
 ^.project$
 ^.pydevproject$
-^test-repo$
+^tests/test-repo$

tests/build-repo.sh

 # init repo
 # -----------------------------------------------------------------------------
 
-rm -rf test-repo
+rm -rf repo
 
-mkdir test-repo
-cd test-repo
+mkdir repo
+cd repo
 hg init
 
 # -----------------------------------------------------------------------------

tests/test-compass

+#!/bin/sh
+
+# This script creates a repository with multiple heads, branches and bookmarks.
+# It's purpose is to create a quite freaky graph, it does not make any sense
+# otherwise.
+
+# -----------------------------------------------------------------------------
+# helper functions
+# -----------------------------------------------------------------------------
+
+edit() {
+	date >> $1
+}
+
+edit_commit() {
+	echo "edit $1"
+	touch $1
+	date >> $1
+	hg ci -Am "Edit $1 in `hg branch` ($2)"
+}
+
+branch_commit() {
+	echo "branching $1"
+	OLD=`hg branch`
+	hg branch $1
+	hg ci -m "Branch from $OLD to $1"
+}
+
+close_branch() {
+	BRANCH=`hg branch`
+	echo "closing branch $BRANCH"
+	hg ci --close-branch -m "Closing branch $BRANCH"
+}
+
+merge_commit() {
+	echo "merging $1"
+	hg merge $1
+	hg ci -m "Merge in revision $1"
+}
+
+update() {
+	echo "update to $1"
+	hg up -C -r $1
+}
+
+# -----------------------------------------------------------------------------
+# init repo
+# -----------------------------------------------------------------------------
+
+rm -rf repo
+
+mkdir repo
+cd repo
+hg init
+
+# -----------------------------------------------------------------------------
+# make history
+# -----------------------------------------------------------------------------
+
+edit_commit f.df "proceed default branch"
+
+branch_commit dev-1.0
+
+edit_commit f.dev-1.0 "proceed dev-1.0"
+
+edit_commit f.dev-1.0 "proceed dev-1.0"
+
+branch_commit dev-1.1 # branch dev-1.0 -> dev-1.1
+
+SPLIT=`hg id -n`
+
+edit_commit f.dev-1.1
+
+update $SPLIT
+
+hg bookmark feature-1.1a
+
+edit_commit f.dev-1.1 "add 2nd head to dev-1.1"
+
+update $SPLIT
+
+edit_commit f.dev-1.1 "add 3rd head to dev-1.1"
+
+update dev-1.0
+
+edit_commit f.dev-1.0 "proceed dev-1.0"
+
+SPLIT=`hg id -n`
+
+edit_commit f.dev-1.0 "proceed dev-1.0"
+
+update $SPLIT
+
+edit_commit f.dev-1.0  "add 2nd head to dev-1.0"
+
+update $SPLIT
+
+edit_commit f.dev-1.0  "add 3rd head to dev-1.0"
+
+merge_commit dev-1.1 # merge 3rd head of dev-1.1 into 3rd head of dev-1.0
+
+edit_commit f.dev-1.0 "proceed merged head"
+
+update $SPLIT
+
+branch_commit dev-2.0 # branch dev-1.0 -> dev-2.0
+
+edit_commit f.dev-2.0 "proceed 1st head of dev-2.0"
+
+close_branch
+
+edit_commit f.dev-2.0 "reopen closed branch dev-2.0"
+
+update $SPLIT
+
+branch_commit dev-1.2 # branch dev-1.0 -> dev-1.2
+
+edit_commit f.dev-1.2 "proceed 1st head of dev-1.2"
+
+close_branch
+
+update $SPLIT
+
+branch_commit feature-foo # branch dev-1.0 -> feature-foo
+
+edit_commit f.feature-foo "proceed 1st head of feature-foo"
+
+close_branch
+
+update dev-1.0
+
+merge_commit feature-foo # merge feature-foo into dev-1.0
+
+# done, now let's "compass" this hell of a repo ..
+
+# hg compass
+# while (you-are-not-bored) ; do
+#     hg up ...
+#     hg compass
+# done
+
+TIP_REV=`hg tip --template={rev}`
+
+for rev in `seq 0 $TIP_REV` ; do
+	hg up -C $rev;
+	hg compass | sed -r "s/\[[_a-zA-Z0-9 ]+\]/[age]/" # fix age
+done

tests/test-compass.sh

-#!/bin/sh
-
-TIP_REV=`hg tip --template={rev}`
-
-./build-repo.sh > /dev/null 2>&1
-
-cd test-repo
-
-for rev in `seq 0 $TIP_REV` ; do
-	hg up -C $rev;
-	hg compass | sed -r "s/\[[_a-zA-Z0-9 ]+\]/[age]/" # fix age
-done
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.