From f24caa48eedfb9d4f7218892bc7070316ac553f2 Mon Sep 17 00:00:00 2001 From: zuber Date: Fri, 27 Nov 2009 11:46:22 +0100 Subject: [PATCH 1/1] =?utf8?q?Dodanie=20wi=C4=99kszej=20ilo=C5=9Bci=20test?= =?utf8?q?=C3=B3w=20i=20usuni=C4=99cie=20zb=C4=99dnego=20kodu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/tests/test_vstorage.py | 8 +++++++- lib/vstorage/__init__.py | 9 ++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/tests/test_vstorage.py b/lib/tests/test_vstorage.py index bcaf9162..0d87f0a8 100644 --- a/lib/tests/test_vstorage.py +++ b/lib/tests/test_vstorage.py @@ -55,7 +55,7 @@ class TestMercurialStorage(object): self.repo.save_text(title, text, author, comment, parent=-1) saved = self.repo.open_page(title).read() assert saved == text - + def test_save_merge_line_conflict(self): text = u"test\ntest\n" text1 = u"test\ntext\n" @@ -91,4 +91,10 @@ text def test_document_not_found(self): self.repo.open_page(u'unknown entity') + def test_open_existing_repository(self): + self.repo.save_text(u'Python!', u'ham and spam') + current_repo_revision = self.repo.repo_revision() + same_repo = vstorage.VersionedStorage(self.repo_path) + assert same_repo.repo_revision() == current_repo_revision + diff --git a/lib/vstorage/__init__.py b/lib/vstorage/__init__.py index 88005da3..e1db0c13 100644 --- a/lib/vstorage/__init__.py +++ b/lib/vstorage/__init__.py @@ -5,8 +5,6 @@ import datetime import mimetypes import urllib -import sys - # Note: we have to set these before importing Mercurial os.environ['HGENCODING'] = 'utf-8' os.environ['HGMERGE'] = "internal:merge" @@ -137,11 +135,8 @@ class VersionedStorage(object): if p1 == p2: return text - try: - unresolved = mercurial.merge.update(self.repo, tip_node, True, False, partial) - except mercurial.util.Abort: - raise - unresolved = 1, 1, 1, 1 + # TODO: Check if merge was successful + mercurial.merge.update(self.repo, tip_node, True, False, partial) self.repo.dirstate.setparents(tip_node, node) # Mercurial 1.1 and later need updating the merge state -- 2.20.1