[Pkg-bazaar-commits] ./bzr/unstable r923: - merge aaron's bugfix branch
Martin Pool
mbp at sourcefrog.net
Fri Apr 10 08:13:37 UTC 2009
------------------------------------------------------------
revno: 923
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Fri 2005-07-15 21:07:40 -0300
message:
- merge aaron's bugfix branch
up to abentley at panoramicfeedback.com-20050715134354-78f2bca607acb415
modified:
bzrlib/commands.py
bzrlib/log.py
bzrlib/merge_core.py
bzrlib/selftest/blackbox.py
------------------------------------------------------------
revno: 909.1.1
committer: aaron.bentley at utoronto.ca
timestamp: Thu 2005-07-14 21:56:29 -0400
message:
Fixed handling of merge-revert with no --revision
modified:
bzrlib/commands.py
------------------------------------------------------------
revno: 909.1.2
committer: aaron.bentley at utoronto.ca
timestamp: Thu 2005-07-14 21:57:33 -0400
message:
Fixed rename handling in merge
modified:
bzrlib/changeset.py
bzrlib/merge_core.py
------------------------------------------------------------
revno: 909.1.3
committer: aaron.bentley at utoronto.ca
timestamp: Thu 2005-07-14 23:36:09 -0400
message:
Fixed branch's --revision argument
modified:
bzrlib/commands.py
bzrlib/selftest/blackbox.py
------------------------------------------------------------
revno: 909.1.4
committer: Aaron Bentley <abentley at panoramicfeedback.com>
timestamp: Fri 2005-07-15 09:13:40 -0400
message:
Fixed conflict handling for missing merge targets
modified:
bzrlib/merge_core.py
------------------------------------------------------------
revno: 909.1.5
committer: Aaron Bentley <abentley at panoramicfeedback.com>
timestamp: Fri 2005-07-15 09:43:54 -0400
message:
Fixed log -v (mostly)
modified:
bzrlib/log.py
bzrlib/selftest/blackbox.py
-------------- next part --------------
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py 2005-07-13 05:34:13 +0000
+++ b/bzrlib/commands.py 2005-07-16 00:07:40 +0000
@@ -594,11 +594,11 @@
import tempfile
cache_root = tempfile.mkdtemp()
- if revision is not None:
- if len(revision) > 1:
- raise BzrCommandError('bzr branch --revision takes exactly 1 revision value')
- else:
+ if revision is None:
revision = [None]
+ elif len(revision) > 1:
+ raise BzrCommandError('bzr branch --revision takes exactly 1 revision value')
+
try:
try:
br_from = find_cached_branch(from_location, cache_root)
@@ -628,7 +628,10 @@
br_to.set_root_id(br_from.get_root_id())
if revision:
- revno = br_to.lookup_revision(revision[0])
+ if revision[0] is None:
+ revno = br_from.revno()
+ else:
+ revno, rev_id = br_from.get_revision_info(revision[0])
try:
br_to.update_revisions(br_from, stop_revision=revno)
except NoSuchRevision:
=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py 2005-07-12 01:30:55 +0000
+++ b/bzrlib/log.py 2005-07-16 00:07:40 +0000
@@ -222,7 +222,7 @@
if not last_revno:
if revno == 1:
- last_tree = EmptyTree()
+ last_tree = EmptyTree(branch.get_root_id())
else:
last_revno = revno - 1
last_revision_id = branch.revision_history()[last_revno]
=== modified file 'bzrlib/merge_core.py'
--- a/bzrlib/merge_core.py 2005-07-11 23:13:33 +0000
+++ b/bzrlib/merge_core.py 2005-07-16 00:07:40 +0000
@@ -50,8 +50,8 @@
new_cset.add_entry(entry)
else:
new_entry = make_merged_entry(entry, inventory, conflict_handler)
- new_contents = make_merged_contents(entry, this, base, other,
- conflict_handler)
+ new_contents = make_merged_contents(entry, this, base, other,
+ inventory, conflict_handler)
new_entry.contents_change = new_contents
new_entry.metadata_change = make_merged_metadata(entry, base, other)
new_cset.add_entry(new_entry)
@@ -116,7 +116,7 @@
return new_entry
-def make_merged_contents(entry, this, base, other, conflict_handler):
+def make_merged_contents(entry, this, base, other, inventory, conflict_handler):
contents = entry.contents_change
if contents is None:
return None
@@ -214,6 +214,10 @@
os.chmod(self.abs_path(path), mode)
self.inventory[id] = path
+ def remove_file(self, id):
+ os.unlink(self.full_path(id))
+ del self.inventory[id]
+
def add_dir(self, id, parent, name, mode):
path = self.child_path(parent, name)
full_path = self.abs_path(path)
@@ -226,7 +230,11 @@
return os.path.join(self.dir, path)
def full_path(self, id):
- return self.abs_path(self.inventory[id])
+ try:
+ tree_path = self.inventory[id]
+ except KeyError:
+ return None
+ return self.abs_path(tree_path)
def readonly_path(self, id):
return self.full_path(id)
@@ -259,6 +267,22 @@
path = self.get_cset_path(parent, name)
self.cset.add_entry(changeset.ChangesetEntry(id, parent, path))
+ def remove_file(self, id, base=False, this=False, other=False):
+ for option, tree in ((base, self.base), (this, self.this),
+ (other, self.other)):
+ if option:
+ tree.remove_file(id)
+ if other or base:
+ change = self.cset.entries[id].contents_change
+ assert isinstance(change, changeset.ReplaceContents)
+ if other:
+ change.new_contents=None
+ if base:
+ change.old_contents=None
+ if change.old_contents is None and change.new_contents is None:
+ change = None
+
+
def add_dir(self, id, parent, name, mode):
path = self.get_cset_path(parent, name)
self.base.add_dir(id, parent, name, mode)
@@ -505,6 +529,21 @@
cset)
builder.cleanup()
+ builder = MergeBuilder()
+ builder.add_file("1", "0", "name1", "text1", 0755)
+ builder.change_contents("1", other="text4", base="text3")
+ builder.remove_file("1", base=True)
+ self.assertRaises(changeset.NewContentsConflict,
+ builder.merge_changeset)
+ builder.cleanup()
+
+ builder = MergeBuilder()
+ builder.add_file("1", "0", "name1", "text1", 0755)
+ builder.change_contents("1", other="text4", base="text3")
+ builder.remove_file("1", this=True)
+ self.assertRaises(changeset.MissingForMerge, builder.merge_changeset)
+ builder.cleanup()
+
def test_perms_merge(self):
builder = MergeBuilder()
builder.add_file("1", "0", "name1", "text1", 0755)
=== modified file 'bzrlib/selftest/blackbox.py'
--- a/bzrlib/selftest/blackbox.py 2005-07-11 07:18:20 +0000
+++ b/bzrlib/selftest/blackbox.py 2005-07-15 13:43:54 +0000
@@ -285,7 +285,13 @@
runbzr('log')
runbzr('log -v')
-
+ runbzr('log -v --forward')
+ runbzr('log -m', retcode=1)
+ log_out = backtick('bzr log -m commit')
+ assert "this is my new commit" in log_out
+ assert "rename nested" not in log_out
+ assert 'revision-id' not in log_out
+ assert 'revision-id' in backtick('bzr log --show-ids -m commit')
progress("file with spaces in name")
@@ -316,6 +322,13 @@
# Can't create a branch if its parent doesn't exist
runbzr('branch /unlikely/to/exist', retcode=1)
runbzr('branch branch1 branch2')
+ assert exists('branch2')
+ assert exists('branch2/sub1')
+ assert exists('branch2/sub1/hello.txt')
+
+ runbzr('branch --revision 0 branch1 branch3')
+ assert not exists('branch3/sub1/hello.txt')
+ runbzr('branch --revision 0..3 branch1 branch4', retcode=1)
progress("pull")
chdir('branch1')
More information about the Pkg-bazaar-commits
mailing list