[MERGE][#238227] Fix the tree.branch returned by make_branch_and_tree

John Arbash Meinel john at arbash-meinel.com
Thu Jun 12 14:19:25 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
| Andrew Bennetts wrote:
|> John Arbash Meinel wrote:
|> [...]
|>> I'm really happy to see this, and we need to get the rest of the tests passing.
|>> (It also effected the "bzr pull" in a lightweight checkout of a bzr+ssh://
branch).
|>>
|>>
|>> +                if b._format.get_format_string() == 'Remote BZR Branch':
|>>
|>> ^- Is this really the best way to detect that you are using a remote branch?
|>> Could we do something like:
|>>
|>> if wt.branch._format != b._format, or something along those lines?
|> I'm equally happy with that.  It's probably better, I forget why I hesistated
|> from doing that in the first place.  You could even test for "wt.branch is not
|> b" directly.
|
| Here's an updated patch.  It makes the change suggested by John, and also fixes
| all the test failures in the *_implementations tests, so it's now a genuine
| candidate for merging to bzr.dev.
|
| One of the fixes required adding another (optional) parameter to Branch.pull.
| I've noted it in the API CHANGES section of the NEWS file, but I'm highlighting
| it here because I expect it will break bzr-svn.
|
| This patch based off the remote_is_at_least changes submitted a while ago
| because it's now part of a loom for my smart push work, but I can extract the
| relevant changes and submit them separately if necessary.
|
| -Andrew.
|
|

BB:approve

+            if tree.branch.last_revision_info() != (3, r5):
+                # RemoteBranch silently corrects an impossible revision
+                # history given to set_revision_history.  It can be tricked
+                # with set_last_revision_info though.
+                tree.branch.set_last_revision_info(3, r5)

^- one of the problems with trying to test stuff like "reconcile" is that you
have to create something broken first. And as we fix apis to not allow broken
data, it becomes harder to test fixing broken data. I'm curious what stuff like
TDD says about that. Is it that you need to be using mocks at this point?

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhRIl0ACgkQJdeBCYSNAAO8XQCcCUjLhM/W+KTTLU3zjoQyfolK
Vu8AnjMmT+KDDf1JkmNkuMs4tDImG2pD
=nEID
-----END PGP SIGNATURE-----



More information about the bazaar mailing list