##// END OF EJS Templates
Synced vcs with upstream
marcink -
r2543:03a77098 beta
parent child Browse files
Show More
@@ -10,7 +10,7 b''
10 :copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak.
10 :copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak.
11 """
11 """
12
12
13 VERSION = (0, 2, 3, 'dev')
13 VERSION = (0, 3, 0, 'dev')
14
14
15 __version__ = '.'.join((str(each) for each in VERSION[:4]))
15 __version__ = '.'.join((str(each) for each in VERSION[:4]))
16
16
@@ -15,7 +15,6 b' from rhodecode.lib.vcs.nodes import File'
15 from rhodecode.lib.vcs.utils import safe_unicode
15 from rhodecode.lib.vcs.utils import safe_unicode
16 from rhodecode.lib.vcs.utils import date_fromtimestamp
16 from rhodecode.lib.vcs.utils import date_fromtimestamp
17 from rhodecode.lib.vcs.utils.lazy import LazyProperty
17 from rhodecode.lib.vcs.utils.lazy import LazyProperty
18 from dulwich.objects import Commit, Tag
19
18
20
19
21 class GitChangeset(BaseChangeset):
20 class GitChangeset(BaseChangeset):
@@ -29,7 +28,7 b' class GitChangeset(BaseChangeset):'
29
28
30 try:
29 try:
31 commit = self.repository._repo.get_object(revision)
30 commit = self.repository._repo.get_object(revision)
32 if isinstance(commit, Tag):
31 if isinstance(commit, objects.Tag):
33 revision = commit.object[1]
32 revision = commit.object[1]
34 commit = self.repository._repo.get_object(commit.object[1])
33 commit = self.repository._repo.get_object(commit.object[1])
35 except KeyError:
34 except KeyError:
@@ -12,8 +12,7 b' from rhodecode.lib.vcs.nodes import Adde'
12 from rhodecode.lib.vcs.utils import safe_str, safe_unicode, date_fromtimestamp
12 from rhodecode.lib.vcs.utils import safe_str, safe_unicode, date_fromtimestamp
13 from rhodecode.lib.vcs.utils.lazy import LazyProperty
13 from rhodecode.lib.vcs.utils.lazy import LazyProperty
14 from rhodecode.lib.vcs.utils.paths import get_dirs_for_path
14 from rhodecode.lib.vcs.utils.paths import get_dirs_for_path
15
15 from rhodecode.lib.vcs.utils.hgcompat import archival, hex
16 from ...utils.hgcompat import archival, hex
17
16
18
17
19 class MercurialChangeset(BaseChangeset):
18 class MercurialChangeset(BaseChangeset):
@@ -4,7 +4,7 b' import errno'
4 from rhodecode.lib.vcs.backends.base import BaseInMemoryChangeset
4 from rhodecode.lib.vcs.backends.base import BaseInMemoryChangeset
5 from rhodecode.lib.vcs.exceptions import RepositoryError
5 from rhodecode.lib.vcs.exceptions import RepositoryError
6
6
7 from ...utils.hgcompat import memfilectx, memctx, hex, tolocal
7 from rhodecode.lib.vcs.utils.hgcompat import memfilectx, memctx, hex, tolocal
8
8
9
9
10 class MercurialInMemoryChangeset(BaseInMemoryChangeset):
10 class MercurialInMemoryChangeset(BaseInMemoryChangeset):
@@ -18,7 +18,7 b' from rhodecode.lib.vcs.utils.lazy import'
18 from rhodecode.lib.vcs.utils.ordered_dict import OrderedDict
18 from rhodecode.lib.vcs.utils.ordered_dict import OrderedDict
19 from rhodecode.lib.vcs.utils.paths import abspath
19 from rhodecode.lib.vcs.utils.paths import abspath
20
20
21 from ...utils.hgcompat import ui, nullid, match, patch, diffopts, clone, \
21 from rhodecode.lib.vcs.utils.hgcompat import ui, nullid, match, patch, diffopts, clone, \
22 get_contact, pull, localrepository, RepoLookupError, Abort, RepoError, hex
22 get_contact, pull, localrepository, RepoLookupError, Abort, RepoError, hex
23
23
24
24
@@ -1,7 +1,7 b''
1 from rhodecode.lib.vcs.backends.base import BaseWorkdir
1 from rhodecode.lib.vcs.backends.base import BaseWorkdir
2 from rhodecode.lib.vcs.exceptions import BranchDoesNotExistError
2 from rhodecode.lib.vcs.exceptions import BranchDoesNotExistError
3
3
4 from ...utils.hgcompat import hg_merge
4 from rhodecode.lib.vcs.utils.hgcompat import hg_merge
5
5
6
6
7 class MercurialWorkdir(BaseWorkdir):
7 class MercurialWorkdir(BaseWorkdir):
@@ -16,7 +16,7 b' import mimetypes'
16 from pygments import lexers
16 from pygments import lexers
17
17
18 from rhodecode.lib.vcs.utils.lazy import LazyProperty
18 from rhodecode.lib.vcs.utils.lazy import LazyProperty
19 from rhodecode.lib.vcs.utils import safe_unicode, safe_str
19 from rhodecode.lib.vcs.utils import safe_unicode
20 from rhodecode.lib.vcs.exceptions import NodeError
20 from rhodecode.lib.vcs.exceptions import NodeError
21 from rhodecode.lib.vcs.exceptions import RemovedFileNodeError
21 from rhodecode.lib.vcs.exceptions import RemovedFileNodeError
22 from rhodecode.lib.vcs.backends.base import EmptyChangeset
22 from rhodecode.lib.vcs.backends.base import EmptyChangeset
@@ -119,6 +119,14 b' class ChangesetsWithCommitsTestCaseixin('
119 branch_name=self.repo.DEFAULT_BRANCH_NAME)
119 branch_name=self.repo.DEFAULT_BRANCH_NAME)
120 self.assertNotIn(doc_changeset, default_branch_changesets)
120 self.assertNotIn(doc_changeset, default_branch_changesets)
121
121
122 def test_get_changeset_by_branch(self):
123 for branch, sha in self.repo.branches.iteritems():
124 self.assertEqual(sha, self.repo.get_changeset(branch).raw_id)
125
126 def test_get_changeset_by_tag(self):
127 for tag, sha in self.repo.tags.iteritems():
128 self.assertEqual(sha, self.repo.get_changeset(tag).raw_id)
129
122
130
123 class ChangesetsTestCaseMixin(BackendTestMixin):
131 class ChangesetsTestCaseMixin(BackendTestMixin):
124 recreate_repo_per_test = False
132 recreate_repo_per_test = False
General Comments 0
You need to be logged in to leave comments. Login now