Commits

Oben Sonne committed 04c6ccc

Update tests

The default test script (test-compass) now also works outside the
Mercurial testing suite. Thus the other scripts have been removed.
Further test-compass is less verbose now, to only print out the
interesting parts to test.

Finally the following tests have been added to test-compass:
- detect virgin repository
- detect merge situation
- correctly detect and handle bookmarks track.current option

Comments (0)

Files changed (7)

 syntax: glob
 *.pyc
 *~
-tests/**.act
-tests/**.diff
-tests/repo
+tests/testrepo
+tests/*.err
 
 syntax: regexp
 ^.project$

tests/extra/build-repo.sh

-#!/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
-

tests/extra/run-tests.sh

-#!/bin/sh
-
-rm *.act *.diff
-
-./build-repo.sh
-
-TESTS="test-compass.sh"
-
-EXIT=0
-
-for TF in $TESTS ; do
-	
-	NAME=`echo $TF | sed -r "s/\.(sh)|(py)$//"`
-	
-	echo -n "Running $NAME .. "
-	
-	./$TF > $NAME.act
-	
-	DIFF="`diff -Nur $NAME.exp $NAME.act`"
-	
-	if [ -n "$DIFF" ] ; then
-		echo "failed, see $NAME.diff"
-		echo "$DIFF" > $NAME.diff
-		EXIT=1
-	else
-		echo "success" 
-	fi
-	
-done
-
-exit $EXIT

tests/extra/test-compass.exp

-#=============================================================================#
-#                      You are at an inactive branch head                     #
-#=============================================================================#
-Rev      0 default                                          @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                           @above @closed @b-tip [age]
-Rev     17 dev-2.0                                   @above @b-tip [age]
-Rev     10 dev-1.0                                    @above @anon [age]
-Rev      9 dev-1.0                                    @above @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                           @above [age]
-Rev      5 dev-1.1                                    @above @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default*                           1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev      1 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                           @above @closed @b-tip [age]
-Rev     17 dev-2.0                                   @above @b-tip [age]
-Rev     10 dev-1.0                                    @above @anon [age]
-Rev      9 dev-1.0                                    @above @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                           @above [age]
-Rev      5 dev-1.1                                    @above @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev      2 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                           @above @closed @b-tip [age]
-Rev     17 dev-2.0                                   @above @b-tip [age]
-Rev     10 dev-1.0                                    @above @anon [age]
-Rev      9 dev-1.0                                    @above @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                           @above [age]
-Rev      5 dev-1.1                                    @above @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev      3 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                           @above @closed @b-tip [age]
-Rev     17 dev-2.0                                   @above @b-tip [age]
-Rev     10 dev-1.0                                    @above @anon [age]
-Rev      9 dev-1.0                                    @above @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                           @above [age]
-Rev      5 dev-1.1                                    @above @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev      4 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                           @above [age]
-Rev      5 dev-1.1                                    @above @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1*                           3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                              You are at a head                              #
-#=============================================================================#
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                 Other heads                                 #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1*                           3 heads (2 active, 1 inactive, 1 bookmarked)
-#=============================================================================#
-#                              You are at a head                              #
-#=============================================================================#
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-#-----------------------------------------------------------------------------#
-#                                 Other heads                                 #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1*                           3 heads (2 active, 1 inactive, 1 bookmarked)
-#=============================================================================#
-#                      You are at an inactive branch head                     #
-#=============================================================================#
-Rev      7 dev-1.1                                          @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1*                           3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev      8 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                           @above @closed @b-tip [age]
-Rev     17 dev-2.0                                   @above @b-tip [age]
-Rev     10 dev-1.0                                    @above @anon [age]
-Rev      9 dev-1.0                                    @above @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                              You are at a head                              #
-#=============================================================================#
-Rev      9 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                 Other heads                                 #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#=============================================================================#
-#                              You are at a head                              #
-#=============================================================================#
-Rev     10 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                 Other heads                                 #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev     11 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev     12 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev     13 dev-1.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev     14 dev-2.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                   @above @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0*                           1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev     15 dev-2.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                   @above @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0*                           1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                    You are lost in the middle of nowhere                    #
-#=============================================================================#
-Rev     16 dev-2.0                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                   @above @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0*                           1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                              You are at a head                              #
-#=============================================================================#
-Rev     17 dev-2.0                                          @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                                 Other heads                                 #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0*                           1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#=============================================================================#
-#           You are lost in the middle of nowhere in a closed branch          #
-#=============================================================================#
-Rev     18 dev-1.2                                   @closed @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                           @above @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2* (closed)                  1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#           You are lost in the middle of nowhere in a closed branch          #
-#=============================================================================#
-Rev     19 dev-1.2                                   @closed @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     20 dev-1.2                           @above @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2* (closed)                  1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                     You are at a head in a closed branch                    #
-#=============================================================================#
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                                 Other heads                                 #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2* (closed)                  1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#=============================================================================#
-#           You are lost in the middle of nowhere in a closed branch          #
-#=============================================================================#
-Rev     21 feature-foo                               @closed @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo* (closed)              1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#           You are lost in the middle of nowhere in a closed branch          #
-#=============================================================================#
-Rev     22 feature-foo                               @closed @anon [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo* (closed)              1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#            You are at an inactive branch head in a closed branch            #
-#=============================================================================#
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                                    Heads                                    #
-#-----------------------------------------------------------------------------#
-Rev     24 dev-1.0                               tip @above @b-tip [age]
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo* (closed)              1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
-#-----------------------------------------------------------------------------#
-#                     Next commit will create a new head!                     #
-#-----------------------------------------------------------------------------#
-#=============================================================================#
-#                              You are at a head                              #
-#=============================================================================#
-Rev     24 dev-1.0                                      tip @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                                 Other heads                                 #
-#-----------------------------------------------------------------------------#
-Rev     20 dev-1.2                                  @closed @b-tip [age]
-Rev     17 dev-2.0                                          @b-tip [age]
-Rev     10 dev-1.0                                           @anon [age]
-Rev      9 dev-1.0                                           @anon [age]
-Rev      6 dev-1.1 (feature-1.1a)                                  [age]
-Rev      5 dev-1.1                                           @anon [age]
-#-----------------------------------------------------------------------------#
-#                            Inactive branch heads                            #
-#-----------------------------------------------------------------------------#
-Rev      0 default                                          @b-tip [age]
-Rev      7 dev-1.1                                          @b-tip [age]
-Rev     23 feature-foo                              @closed @b-tip [age]
-#-----------------------------------------------------------------------------#
-#                               Branch overview                               #
-#-----------------------------------------------------------------------------#
-default                            1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
-feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
-dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
-dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
-dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)

tests/extra/test-compass.sh

-#!/bin/sh
-
-TEST_REPO=repo
-
-TIP_REV=`hg -R $TEST_REPO tip --template={rev}`
-
-for rev in `seq 0 $TIP_REV` ; do
-	hg -R $TEST_REPO up -C $rev > /dev/null 2>&1
-	hg -R $TEST_REPO compass | sed -r "s/\[[_a-zA-Z0-9 ]+\]/[age]/" # fix age
-done
 #!/bin/sh
 
-[ -z "$HGRCPATH" ] && cat << EOF
-This is not a stand-alone test script. It only works within the Mercurial test
-suite. Step into 'extra' for manual testings.
-EOF
-[ -z "$HGRCPATH" ] && exit 1
+# -----------------------------------------------------------------------------
+# init
+# -----------------------------------------------------------------------------
 
-cat >> $HGRCPATH <<EOF
+[ -n "$HGRCPATH" ] && cat >> $HGRCPATH <<EOF
 [extensions]
 hgext.bookmarks=
 hgext.compass=
 EOF
 
+export COLUMNS=80
+
+HGDO="hg -q"
+HGCI="$HGDO ci -d 1970-1-1 -u test"
+
+rm -rf testrepo
+mkdir testrepo
+cd testrepo
+$HGDO init
+cat >> .hg/hgrc << EOF
+[bookmarks]
+track.current = False
+EOF
+
 # -----------------------------------------------------------------------------
 # helper functions to setup the test repo
 # -----------------------------------------------------------------------------
 
 edit_commit() {
 	edit  $1
-	hg ci -Am "Edit $1 in `hg branch` ($2)" -d "0 0" -u "test"
+	$HGCI -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" -d "0 0" -u "test"
+	$HGDO branch $1
+	$HGCI -m "Branch from $OLD to $1"
 }
 
 close_branch() {
 	BRANCH=`hg branch`
 	echo "closing branch $BRANCH"
-	hg ci --close-branch -m "Closing branch $BRANCH" -d "0 0" -u "test"
+	$HGCI --close-branch -m "Closing branch $BRANCH"
 }
 
 merge_commit() {
 	echo "merging $1"
-	hg merge $1
-	hg ci -m "Merge in revision $1" -d "0 0" -u "test"
+	$HGDO merge $1
+	hg compass
+	$HGCI -m "Merge in revision $1"
 }
 
 update() {
 	echo "update to $1"
-	hg up -C -r $1
+	$HGDO up -C -r $1
+}
+
+hg_compass() {
+    hg compass $1 | sed -r "s/\[[_a-zA-Z0-9 ]+\]/[age]/" # fix age
 }
 
 # -----------------------------------------------------------------------------
-# init repo
+# first test in virgin repository
 # -----------------------------------------------------------------------------
 
-hg init
+hg_compass
 
 # -----------------------------------------------------------------------------
 # make history
 
 update $SPLIT
 
-hg bookmark feature-1.1a
+$HGDO bookmark feature-1.1a
 
 edit_commit f.dev-1.1 "add 2nd head to dev-1.1"
 
 
 for rev in `seq 0 $TIP_REV` ; do
 	echo "-- Updating to $rev"
-	hg up -C $rev
+	$HGDO up -C $rev
 	echo "-- hg compass"
-	hg compass
+	hg_compass
 	echo "-- hg compass -v"
-	hg compass -v
+	hg_compass -v
 	echo "-- hg compass -i"
-	hg compass -i
+	hg_compass -i
 	echo "-- hg compass -b"
-	hg compass -b
+	hg_compass -b
 	echo "-- hg compass -c"
-	hg compass -c
+	hg_compass -c
 	echo "-- hg compass -ibc"
-	hg compass -ibc
-done | sed -r "s/\[[_a-zA-Z0-9 ]+\]/[age]/" # fix age
+	hg_compass -ibc
+done
+
+## check bookmarks track.current option ##
+
+cat >> .hg/hgrc << EOF
+[bookmarks]
+track.current = True
+EOF
+
+$HGDO up -C 7
+hg_compass
+$HGDO up -C 6
+hg_compass
+$HGDO up -C feature-1.1a
+hg_compass
 
 # -----------------------------------------------------------------------------
 # test help output

tests/test-compass.out

+#=============================================================================#
+#                        You are in a virgin repository                       #
+#=============================================================================#
 edit f.df
-adding f.df
 branching dev-1.0
-marked working directory as branch dev-1.0
 edit f.dev-1.0
-adding f.dev-1.0
 edit f.dev-1.0
 branching dev-1.1
-marked working directory as branch dev-1.1
 edit f.dev-1.1
-adding f.dev-1.1
 update to 4
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 edit f.dev-1.1
-adding f.dev-1.1
-created new head
 update to 4
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 edit f.dev-1.1
-adding f.dev-1.1
-created new head
 update to dev-1.0
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 edit f.dev-1.0
-created new head
 edit f.dev-1.0
 update to 8
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-edit f.dev-1.0
-created new head
-update to 8
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-edit f.dev-1.0
-created new head
-merging dev-1.1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
 edit f.dev-1.0
 update to 8
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+edit f.dev-1.0
+merging dev-1.1
+#=============================================================================#
+#                     You are in a merge (with revision 7)                    #
+#=============================================================================#
+Rev     11 dev-1.0                                      tip @b-tip [  39 years]
+#-----------------------------------------------------------------------------#
+#                                 Other heads                                 #
+#-----------------------------------------------------------------------------#
+Rev     10 dev-1.0                                           @anon [  39 years]
+Rev      9 dev-1.0                                           @anon [  39 years]
+Rev      7 dev-1.1                                          @b-tip [  39 years]
+Rev      6 dev-1.1 (feature-1.1a)                                  [  39 years]
+Rev      5 dev-1.1                                           @anon [  39 years]
+#-----------------------------------------------------------------------------#
+#                            Inactive branch heads                            #
+#-----------------------------------------------------------------------------#
+Rev      0 default                                          @b-tip [  39 years]
+#-----------------------------------------------------------------------------#
+#                               Branch overview                               #
+#-----------------------------------------------------------------------------#
+default                            1 heads (0 active, 1 inactive, 0 bookmarked)
+dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
+dev-1.1                            3 heads (3 active, 0 inactive, 1 bookmarked)
+edit f.dev-1.0
+update to 8
 branching dev-2.0
-marked working directory as branch dev-2.0
-created new head
 edit f.dev-2.0
-adding f.dev-2.0
 closing branch dev-2.0
 edit f.dev-2.0
 update to 8
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 branching dev-1.2
-marked working directory as branch dev-1.2
-created new head
 edit f.dev-1.2
-adding f.dev-1.2
 closing branch dev-1.2
 update to 8
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 branching feature-foo
-marked working directory as branch feature-foo
-created new head
 edit f.feature-foo
-adding f.feature-foo
 closing branch feature-foo
 update to dev-1.0
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
 merging feature-foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
+#=============================================================================#
+#                    You are in a merge (with revision 23)                    #
+#=============================================================================#
+Rev     13 dev-1.0                                          @b-tip [  39 years]
+#-----------------------------------------------------------------------------#
+#                                 Other heads                                 #
+#-----------------------------------------------------------------------------#
+Rev     23 feature-foo                          tip @closed @b-tip [  39 years]
+Rev     20 dev-1.2                                  @closed @b-tip [  39 years]
+Rev     17 dev-2.0                                          @b-tip [  39 years]
+Rev     10 dev-1.0                                           @anon [  39 years]
+Rev      9 dev-1.0                                           @anon [  39 years]
+Rev      6 dev-1.1 (feature-1.1a)                                  [  39 years]
+Rev      5 dev-1.1                                           @anon [  39 years]
+#-----------------------------------------------------------------------------#
+#                            Inactive branch heads                            #
+#-----------------------------------------------------------------------------#
+Rev      0 default                                          @b-tip [  39 years]
+Rev      7 dev-1.1                                          @b-tip [  39 years]
+#-----------------------------------------------------------------------------#
+#                               Branch overview                               #
+#-----------------------------------------------------------------------------#
+default                            1 heads (0 active, 1 inactive, 0 bookmarked)
+dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
+feature-foo (closed)               1 heads (1 active, 0 inactive, 0 bookmarked)
+dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
+dev-1.0*                           3 heads (3 active, 0 inactive, 0 bookmarked)
+dev-1.1                            3 heads (2 active, 1 inactive, 1 bookmarked)
 -- Updating to 0
-0 files updated, 0 files merged, 3 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                      You are at an inactive branch head                     #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 1
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 3
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 4
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 5
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                              You are at a head                              #
 Rev      9 dev-1.0                                           @anon [age]
 Rev      6 dev-1.1 (feature-1.1a)                                  [age]
 -- Updating to 6
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                              You are at a head                              #
 Rev      9 dev-1.0                                           @anon [age]
 Rev      5 dev-1.1                                           @anon [age]
 -- Updating to 7
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                      You are at an inactive branch head                     #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 8
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 9
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                              You are at a head                              #
 Rev      6 dev-1.1 (feature-1.1a)                                  [age]
 Rev      5 dev-1.1                                           @anon [age]
 -- Updating to 10
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                              You are at a head                              #
 Rev      6 dev-1.1 (feature-1.1a)                                  [age]
 Rev      5 dev-1.1                                           @anon [age]
 -- Updating to 11
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 12
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 13
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 14
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 15
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 16
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                    You are lost in the middle of nowhere                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 17
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                              You are at a head                              #
 Rev      6 dev-1.1 (feature-1.1a)                                  [age]
 Rev      5 dev-1.1                                           @anon [age]
 -- Updating to 18
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #           You are lost in the middle of nowhere in a closed branch          #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 19
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #           You are lost in the middle of nowhere in a closed branch          #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 20
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                     You are at a head in a closed branch                    #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 21
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #           You are lost in the middle of nowhere in a closed branch          #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 22
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #           You are lost in the middle of nowhere in a closed branch          #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 23
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #            You are at an inactive branch head in a closed branch            #
 #                     Next commit will create a new head!                     #
 #-----------------------------------------------------------------------------#
 -- Updating to 24
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 -- hg compass
 #=============================================================================#
 #                              You are at a head                              #
 Rev      9 dev-1.0                                           @anon [age]
 Rev      6 dev-1.1 (feature-1.1a)                                  [age]
 Rev      5 dev-1.1                                           @anon [age]
+#=============================================================================#
+#                      You are at an inactive branch head                     #
+#=============================================================================#
+Rev      7 dev-1.1                                          @b-tip [age]
+#-----------------------------------------------------------------------------#
+#                                    Heads                                    #
+#-----------------------------------------------------------------------------#
+Rev     24 dev-1.0                               tip @above @b-tip [age]
+Rev     20 dev-1.2                                  @closed @b-tip [age]
+Rev     17 dev-2.0                                          @b-tip [age]
+Rev     10 dev-1.0                                           @anon [age]
+Rev      9 dev-1.0                                           @anon [age]
+Rev      6 dev-1.1 (feature-1.1a)                                  [age]
+Rev      5 dev-1.1                                           @anon [age]
+#-----------------------------------------------------------------------------#
+#                            Inactive branch heads                            #
+#-----------------------------------------------------------------------------#
+Rev      0 default                                          @b-tip [age]
+Rev      7 dev-1.1                                          @b-tip [age]
+Rev     23 feature-foo                              @closed @b-tip [age]
+#-----------------------------------------------------------------------------#
+#                               Branch overview                               #
+#-----------------------------------------------------------------------------#
+default                            1 heads (0 active, 1 inactive, 0 bookmarked)
+dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
+feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
+dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
+dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
+dev-1.1*                           3 heads (2 active, 1 inactive, 1 bookmarked)
+#-----------------------------------------------------------------------------#
+#                     Next commit will create a new head!                     #
+#-----------------------------------------------------------------------------#
+#=============================================================================#
+#                              You are at a head                              #
+#=============================================================================#
+Rev      6 dev-1.1 (feature-1.1a)                                  [age]
+#-----------------------------------------------------------------------------#
+#                                 Other heads                                 #
+#-----------------------------------------------------------------------------#
+Rev     24 dev-1.0                                      tip @b-tip [age]
+Rev     20 dev-1.2                                  @closed @b-tip [age]
+Rev     17 dev-2.0                                          @b-tip [age]
+Rev     10 dev-1.0                                           @anon [age]
+Rev      9 dev-1.0                                           @anon [age]
+Rev      5 dev-1.1                                           @anon [age]
+#-----------------------------------------------------------------------------#
+#                            Inactive branch heads                            #
+#-----------------------------------------------------------------------------#
+Rev      0 default                                          @b-tip [age]
+Rev      7 dev-1.1                                          @b-tip [age]
+Rev     23 feature-foo                              @closed @b-tip [age]
+#-----------------------------------------------------------------------------#
+#                               Branch overview                               #
+#-----------------------------------------------------------------------------#
+default                            1 heads (0 active, 1 inactive, 0 bookmarked)
+dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
+feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
+dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
+dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
+dev-1.1*                           3 heads (2 active, 1 inactive, 1 bookmarked)
+#-----------------------------------------------------------------------------#
+#          None of your bookmarks (feature-1.1a) will move on commit!         #
+#-----------------------------------------------------------------------------#
+#=============================================================================#
+#                              You are at a head                              #
+#=============================================================================#
+Rev      6 dev-1.1 (feature-1.1a*)                                 [age]
+#-----------------------------------------------------------------------------#
+#                                 Other heads                                 #
+#-----------------------------------------------------------------------------#
+Rev     24 dev-1.0                                      tip @b-tip [age]
+Rev     20 dev-1.2                                  @closed @b-tip [age]
+Rev     17 dev-2.0                                          @b-tip [age]
+Rev     10 dev-1.0                                           @anon [age]
+Rev      9 dev-1.0                                           @anon [age]
+Rev      5 dev-1.1                                           @anon [age]
+#-----------------------------------------------------------------------------#
+#                            Inactive branch heads                            #
+#-----------------------------------------------------------------------------#
+Rev      0 default                                          @b-tip [age]
+Rev      7 dev-1.1                                          @b-tip [age]
+Rev     23 feature-foo                              @closed @b-tip [age]
+#-----------------------------------------------------------------------------#
+#                               Branch overview                               #
+#-----------------------------------------------------------------------------#
+default                            1 heads (0 active, 1 inactive, 0 bookmarked)
+dev-2.0                            1 heads (1 active, 0 inactive, 0 bookmarked)
+feature-foo (closed)               1 heads (0 active, 1 inactive, 0 bookmarked)
+dev-1.2 (closed)                   1 heads (1 active, 0 inactive, 0 bookmarked)
+dev-1.0                            3 heads (3 active, 0 inactive, 0 bookmarked)
+dev-1.1*                           3 heads (2 active, 1 inactive, 1 bookmarked)
 -- hg help compass
 hg compass [options]