aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-16 15:37:14 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-16 15:37:14 -0500
commit2b071a28a2cedab54c713948c6b6f4bd27bb45e2 (patch)
tree650c4eaca616c2c7bd0d883fabc1dda0b790db88
parentb5959aee578055431eeb80befde7272754b2b8ad (diff)
downloadbugseverywhere-2b071a28a2cedab54c713948c6b6f4bd27bb45e2.tar.gz
Fixed another bug in git.strip_git() (bug 0cad).
Also added git mode to test_usage.sh. I'll go through and add modes for the other RCSs...
-rw-r--r--.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/202e0dc6-61bf-4b17-a8bd-f8a27482cb68/body10
-rw-r--r--.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/202e0dc6-61bf-4b17-a8bd-f8a27482cb68/values21
-rw-r--r--libbe/git.py2
-rwxr-xr-xtest_usage.sh44
4 files changed, 69 insertions, 8 deletions
diff --git a/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/202e0dc6-61bf-4b17-a8bd-f8a27482cb68/body b/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/202e0dc6-61bf-4b17-a8bd-f8a27482cb68/body
new file mode 100644
index 0000000..ccc18ea
--- /dev/null
+++ b/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/202e0dc6-61bf-4b17-a8bd-f8a27482cb68/body
@@ -0,0 +1,10 @@
+Fixed another bug in git.strip_git(). lstrip() wasn't what I had thought.
+
+>>> "/a.b/.be/x/y".lstrip("/a.b/")
+'e/x/y'
+
+So I went back to just droping the first N chars
+
+>>> "/a.b/.be/x/y"[len("/a.b/"):]
+'.be/x/y'
+
diff --git a/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/202e0dc6-61bf-4b17-a8bd-f8a27482cb68/values b/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/202e0dc6-61bf-4b17-a8bd-f8a27482cb68/values
new file mode 100644
index 0000000..67b182a
--- /dev/null
+++ b/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/202e0dc6-61bf-4b17-a8bd-f8a27482cb68/values
@@ -0,0 +1,21 @@
+
+
+
+Content-type=text/plain
+
+
+
+
+
+
+Date=Sun, 16 Nov 2008 20:36:20 +0000
+
+
+
+
+
+
+From=wking
+
+
+
diff --git a/libbe/git.py b/libbe/git.py
index 172c324..e15d773 100644
--- a/libbe/git.py
+++ b/libbe/git.py
@@ -26,7 +26,7 @@ def strip_git(filename):
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):
diff --git a/test_usage.sh b/test_usage.sh
index e214e75..c751d28 100755
--- a/test_usage.sh
+++ b/test_usage.sh
@@ -4,7 +4,10 @@
# 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
@@ -13,12 +16,39 @@ set -v # verbose, echo commands to stdout
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"
@@ -34,11 +64,11 @@ be comment $BUG "Reopend, comment again"
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 /