~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-03-09 06:39:13 UTC
  • mfrom: (1596.2.6 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060309063913-6d8ce700706d0802
Merge knit performance stage 1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2032
2032
                raise BzrCommandError("No missing location known or specified.")
2033
2033
            print "Using last location: " + local_branch.get_parent()
2034
2034
        remote_branch = bzrlib.branch.Branch.open(other_branch)
2035
 
        local_extra, remote_extra = find_unmerged(local_branch, remote_branch)
2036
 
        if (log_format == None):
2037
 
            default = bzrlib.config.BranchConfig(local_branch).log_format()
2038
 
            log_format = get_log_format(long=long, short=short, line=line, default=default)
2039
 
        lf = log_formatter(log_format, sys.stdout,
2040
 
                           show_ids=show_ids,
2041
 
                           show_timezone='original')
2042
 
        if reverse is False:
2043
 
            local_extra.reverse()
2044
 
            remote_extra.reverse()
2045
 
        if local_extra and not theirs_only:
2046
 
            print "You have %d extra revision(s):" % len(local_extra)
2047
 
            for data in iter_log_data(local_extra, local_branch.repository,
2048
 
                                      verbose):
2049
 
                lf.show(*data)
2050
 
            printed_local = True
2051
 
        else:
2052
 
            printed_local = False
2053
 
        if remote_extra and not mine_only:
2054
 
            if printed_local is True:
2055
 
                print "\n\n"
2056
 
            print "You are missing %d revision(s):" % len(remote_extra)
2057
 
            for data in iter_log_data(remote_extra, remote_branch.repository, 
2058
 
                                      verbose):
2059
 
                lf.show(*data)
2060
 
        if not remote_extra and not local_extra:
2061
 
            status_code = 0
2062
 
            print "Branches are up to date."
2063
 
        else:
2064
 
            status_code = 1
2065
 
        if parent is None and other_branch is not None:
2066
 
            local_branch.set_parent(other_branch)
2067
 
        return status_code
 
2035
        remote_branch.lock_read()
 
2036
        try:
 
2037
            local_branch.lock_write()
 
2038
            try:
 
2039
                local_extra, remote_extra = find_unmerged(local_branch, remote_branch)
 
2040
                if (log_format == None):
 
2041
                    default = bzrlib.config.BranchConfig(local_branch).log_format()
 
2042
                    log_format = get_log_format(long=long, short=short, line=line, default=default)
 
2043
                lf = log_formatter(log_format, sys.stdout,
 
2044
                                   show_ids=show_ids,
 
2045
                                   show_timezone='original')
 
2046
                if reverse is False:
 
2047
                    local_extra.reverse()
 
2048
                    remote_extra.reverse()
 
2049
                if local_extra and not theirs_only:
 
2050
                    print "You have %d extra revision(s):" % len(local_extra)
 
2051
                    for data in iter_log_data(local_extra, local_branch.repository,
 
2052
                                              verbose):
 
2053
                        lf.show(*data)
 
2054
                    printed_local = True
 
2055
                else:
 
2056
                    printed_local = False
 
2057
                if remote_extra and not mine_only:
 
2058
                    if printed_local is True:
 
2059
                        print "\n\n"
 
2060
                    print "You are missing %d revision(s):" % len(remote_extra)
 
2061
                    for data in iter_log_data(remote_extra, remote_branch.repository, 
 
2062
                                              verbose):
 
2063
                        lf.show(*data)
 
2064
                if not remote_extra and not local_extra:
 
2065
                    status_code = 0
 
2066
                    print "Branches are up to date."
 
2067
                else:
 
2068
                    status_code = 1
 
2069
                if parent is None and other_branch is not None:
 
2070
                    local_branch.set_parent(other_branch)
 
2071
                return status_code
 
2072
            finally:
 
2073
                local_branch.unlock()
 
2074
        finally:
 
2075
            remote_branch.unlock()
2068
2076
 
2069
2077
 
2070
2078
class cmd_plugins(Command):