summaryrefslogtreecommitdiff
path: root/test/test_repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-23 17:40:41 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-23 18:03:35 +0100
commit5bd7d44ff7e51105e3e277aee109a45c42590572 (patch)
treeea60a64f3b545158442746a695b4c51766bb6f6e /test/test_repo.py
parent9ccd777c386704911734ae4c33a922a5682ac6c8 (diff)
downloadgitpython-5bd7d44ff7e51105e3e277aee109a45c42590572.tar.gz
repo.rev_parse: Added support for simple log parsing - dates are not yet supported, mainly because I don't need it
Diffstat (limited to 'test/test_repo.py')
-rw-r--r--test/test_repo.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/test/test_repo.py b/test/test_repo.py
index 59a1f6bf..820fed26 100644
--- a/test/test_repo.py
+++ b/test/test_repo.py
@@ -467,11 +467,12 @@ class TestRepo(TestBase):
def test_rev_parse(self):
rev_parse = self.rorepo.rev_parse
- # try special case: This one failed beforehand
+ # try special case: This one failed at some point, make sure its fixed
assert rev_parse("33ebe").hexsha == "33ebe7acec14b25c5f84f35a664803fcab2f7781"
# start from reference
num_resolved = 0
+
for ref in Reference.iter_items(self.rorepo):
path_tokens = ref.path.split("/")
for pt in range(len(path_tokens)):
@@ -546,9 +547,25 @@ class TestRepo(TestBase):
# missing starting brace
self.failUnlessRaises(ValueError, rev_parse, '0.1.4^tree}')
+ # REVLOG
+ #######
+ head = self.rorepo.head
+
+ # need to specify a ref when using the @ syntax
+ self.failUnlessRaises(BadObject, rev_parse, "%s@{0}" % head.commit.hexsha)
+
+ # uses HEAD.ref by default
+ assert rev_parse('@{0}') == head.commit
+ if not head.is_detached:
+ assert rev_parse('%s@{0}' % head.ref.name) == head.ref.commit
+ #END operate on non-detached head
+
+ # the last position
+ assert rev_parse('@{1}') != head.commit
+
+ # currently, nothing more is supported
+ self.failUnlessRaises(NotImplementedError, rev_parse, "@{1 week ago}")
- # cannot handle rev-log for now
- self.failUnlessRaises(ValueError, rev_parse, "hi@there")
def test_repo_odbtype(self):
target_type = GitDB