29
28
revision as _mod_revision,
34
33
from bzrlib.bzrdir import BzrDir
35
from bzrlib.conflicts import (DuplicateEntry, DuplicateID, MissingParent,
36
UnversionedParent, ParentLoop, DeletingParent,
34
from bzrlib.conflicts import (
38
43
from bzrlib.diff import show_diff_trees
39
from bzrlib.errors import (DuplicateKey, MalformedTransform, NoSuchFile,
40
ReusingTransform, CantMoveRoot,
41
PathsNotVersionedError, ExistingLimbo,
42
ExistingPendingDeletion, ImmortalLimbo,
43
ImmortalPendingDeletion, LockError)
44
from bzrlib.osutils import file_kind, pathjoin
44
from bzrlib.errors import (
47
ExistingPendingDeletion,
49
ImmortalPendingDeletion,
55
from bzrlib.osutils import (
45
59
from bzrlib.merge import Merge3Merger, Merger
46
60
from bzrlib.tests import (
53
from bzrlib.transform import (TreeTransform, ROOT_PARENT, FinalPaths,
54
resolve_conflicts, cook_conflicts,
55
build_tree, get_backup_name,
56
_FileMover, resolve_checkout,
57
TransformPreview, create_from_tree)
67
from bzrlib.transform import (
60
82
class TestTreeTransform(tests.TestCaseWithTransport):
2091
2113
self.assertRaises(errors.MalformedTransform, tt.commit, branch,
2116
def test_commit_rich_revision_data(self):
2117
branch, tt = self.get_branch_and_transform()
2118
rev_id = tt.commit(branch, 'message', timestamp=1, timezone=43201,
2119
committer='me <me@example.com>',
2120
revprops={'foo': 'bar'}, revision_id='revid-1',
2121
authors=['Author1 <author1@example.com>',
2122
'Author2 <author2@example.com>',
2124
self.assertEqual('revid-1', rev_id)
2125
revision = branch.repository.get_revision(rev_id)
2126
self.assertEqual(1, revision.timestamp)
2127
self.assertEqual(43201, revision.timezone)
2128
self.assertEqual('me <me@example.com>', revision.committer)
2129
self.assertEqual(['Author1 <author1@example.com>',
2130
'Author2 <author2@example.com>'],
2131
revision.get_apparent_authors())
2132
del revision.properties['authors']
2133
self.assertEqual({'foo': 'bar',
2134
'branch-nick': 'tree'},
2135
revision.properties)
2137
def test_no_explicit_revprops(self):
2138
branch, tt = self.get_branch_and_transform()
2139
rev_id = tt.commit(branch, 'message', authors=[
2140
'Author1 <author1@example.com>',
2141
'Author2 <author2@example.com>', ])
2142
revision = branch.repository.get_revision(rev_id)
2143
self.assertEqual(['Author1 <author1@example.com>',
2144
'Author2 <author2@example.com>'],
2145
revision.get_apparent_authors())
2146
self.assertEqual('tree', revision.properties['branch-nick'])
2095
2149
class MockTransform(object):