~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2006-03-25 09:40:57 UTC
  • mto: (1666.1.5 integration)
  • mto: This revision was merged to the branch mainline in revision 1671.
  • Revision ID: robertc@robertcollins.net-20060325094057-7061f3085942f35f
Change missing to not require a write lock unless it is setting the parent.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2040
2040
        remote_branch = bzrlib.branch.Branch.open(other_branch)
2041
2041
        remote_branch.lock_read()
2042
2042
        try:
2043
 
            local_branch.lock_write()
 
2043
            local_branch.lock_read()
2044
2044
            try:
2045
2045
                local_extra, remote_extra = find_unmerged(local_branch, remote_branch)
2046
2046
                if (log_format == None):
2072
2072
                    print "Branches are up to date."
2073
2073
                else:
2074
2074
                    status_code = 1
2075
 
                if parent is None and other_branch is not None:
2076
 
                    local_branch.set_parent(other_branch)
2077
 
                return status_code
2078
2075
            finally:
2079
2076
                local_branch.unlock()
 
2077
            if parent is None and other_branch is not None:
 
2078
                local_branch.lock_write()
 
2079
                try:
 
2080
                    if local_branch.get_parent() is not None:
 
2081
                        local_branch.set_parent(other_branch)
 
2082
                finally:
 
2083
                    local_branch.unlock()
 
2084
            return status_code
2080
2085
        finally:
2081
2086
            remote_branch.unlock()
2082
2087