absRepoSlashedDir = os.path.join(absRepoDir,"")
assert filename.startswith(absRepoSlashedDir), \
"file %s not in git repo %s" % (filename, absRepoSlashedDir)
- filename = filename.lstrip(absRepoSlashedDir)
+ filename = filename[len(absRepoSlashedDir):]
return filename
def invoke_client(*args, **kwargs):
# features work, and gives an example of suggested usage to get people
# started.
#
-# usage: test_usage.sh
+# usage: test_usage.sh RCS
+# where RCS is one of:
+# bzr
+# git
set -e # exit imediately on failed command
set -o pipefail # pipes fail if any stage fails
exec 6>&2 # save stderr to file descriptor 6
exec 2>&1 # fd 2 now writes to stdout
-ID=`bzr whoami`
-echo "I am: $ID"
+if [ $# -ne 1 ]
+then
+ echo "usage: test_usage.sh RCS"
+ echo ""
+ echo "where RCS is one of"
+ for RCS in bzr git
+ do
+ echo " $RCS"
+ done
+ exit 1
+fi
+
+RCS="$1"
TESTDIR=`mktemp -d /tmp/BEtest.XXXXXXXXXX`
cd $TESTDIR
-bzr init
+
+if [ "$RCS" == "bzr" ]
+then
+ ID=`bzr whoami`
+ bzr init
+elif [ "$RCS" == "git" ]
+then
+ NAME=`git-config user.name`
+ EMAIL=`git-config user.email`
+ ID="$NAME <$EMAIL>"
+ git init
+else
+ echo "Unrecognized RCS $RCS"
+ exit 1
+fi
+echo "I am '$ID'"
+
be set-root .
OUT=`be new 'having too much fun'`
echo "$OUT"
be status $BUG fixed # set bug status to 'fixed'
be show $BUG # show bug details & comments
be list # list all open bugs
-be list --status closed # list all closed bugs
+be list --status fixed # list all fixed bugs
be assign $BUG # assign the bug to yourself
-be list -m # see bugs assigned to you
+be list -m -s fixed # see fixed bugs assigned to you
be assign $BUG 'Joe' # assign the bug to Joe
-be list --assigned Joe # list the bugs assigned to Joe
+be list -a Joe -s fixed # list the fixed bugs assigned to Joe
be assign $BUG none # assign the bug to noone
be remove $BUG # decide that you don't like that bug after all
cd /