aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-13 08:31:33 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-13 08:31:33 -0500
commitd21c50ece316536b5972725eced19b40d6e2589d (patch)
tree19279560a51ae113e1841f2322e2e67ce4d4d64a /libbe/storage
parent9fa977a31982a2eda08c2c18ade73bd114f477b1 (diff)
downloadbugseverywhere-d21c50ece316536b5972725eced19b40d6e2589d.tar.gz
Fix Git._vcs_revision_id() offset bug.
Diffstat (limited to 'libbe/storage')
-rw-r--r--libbe/storage/vcs/bzr.py5
-rw-r--r--libbe/storage/vcs/git.py10
-rw-r--r--libbe/storage/vcs/hg.py4
3 files changed, 13 insertions, 6 deletions
diff --git a/libbe/storage/vcs/bzr.py b/libbe/storage/vcs/bzr.py
index c847019..7d84415 100644
--- a/libbe/storage/vcs/bzr.py
+++ b/libbe/storage/vcs/bzr.py
@@ -26,13 +26,14 @@ import os
import os.path
import re
import shutil
-import sys
-import unittest
import libbe
import base
+
if libbe.TESTING == True:
import doctest
+ import sys
+ import unittest
def new():
diff --git a/libbe/storage/vcs/git.py b/libbe/storage/vcs/git.py
index 0b006f3..77ddd88 100644
--- a/libbe/storage/vcs/git.py
+++ b/libbe/storage/vcs/git.py
@@ -25,14 +25,15 @@ import os
import os.path
import re
import shutil
-import sys
import unittest
import libbe
import libbe.ui.util.user
import base
+
if libbe.TESTING == True:
import doctest
+ import sys
def new():
@@ -150,7 +151,12 @@ class Git(base.VCS):
raise base.CommandError(args, status, stderr=error)
commits = output.splitlines()
try:
- return commits[index]
+ if index > 0:
+ return commits[index-1]
+ elif index < 0:
+ return commits[index]
+ else:
+ return None
except IndexError:
return None
diff --git a/libbe/storage/vcs/hg.py b/libbe/storage/vcs/hg.py
index f1a7eef..633987a 100644
--- a/libbe/storage/vcs/hg.py
+++ b/libbe/storage/vcs/hg.py
@@ -25,14 +25,14 @@ import os
import os.path
import re
import shutil
-import sys
import libbe
import base
if libbe.TESTING == True:
- import unittest
import doctest
+ import sys
+ import unittest
def new():