How to fix code that uses Merger.check_basis

John Arbash Meinel john at arbash-meinel.com
Tue May 8 08:02:56 UTC 2012


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

On 5/4/2012 2:44 PM, Francis Devereux wrote:
> Hi,
> 
> I use the bzr-transplant plugin, and it stopped working when I
> upgraded to bzr 2.5 because it uses Merger.has_changes().
> 
> I've done a fix that seems to work, but I'd appreciate a quick
> review from someone who understands what has_changes does before I
> submit a merge proposal.
> 
> Here's the change I made
> (http://bazaar.launchpad.net/~frankoid/bzr-transplant/bzr25-fix/revision/19):
>
>  === modified file '__init__.py' --- __init__.py	2011-01-20
> 17:04:16 +0000 +++ __init__.py	2012-05-04 12:39:14 +0000 @@ -76,8
> +76,9 @@ if len(source_revision.parent_ids) > 1: raise
> errors.BzrCommandError("Don't know how to transplant merges.") 
> base_revid = source_revision.parent_ids[0] +    if
> target_wt.has_changes(): +        raise
> errors.UncommittedChanges(target_wt) m =
> merge.Merger.from_revision_ids(None, target_wt, source_revid,
> other_branch=source_branch, base=base_revid) -
> m.check_basis(True) m.merge_type = merge_type m.do_merge() try:
> 
> Thanks,
> 
> Francis
> 
> 

That looks reasonable to me. The only question is whether
bzr-transplant intends to support versions of bzr that doesn't have
"wt.has_changes()", however, that has been a while. So I think this
would be ok.

You'd have to check with the author of bzr-transplant, though.

John
=:->

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

iEYEARECAAYFAk+o0zAACgkQJdeBCYSNAAMrEwCeOCdrIugyjtpATgWE7ATBBSvH
YJwAoIhDYJvuDYG0sZmc7+9EGJlY+ClS
=XvRV
-----END PGP SIGNATURE-----



More information about the bazaar mailing list