~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-07-27 20:05:11 UTC
  • mfrom: (1711.2.100 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060727200511-3bfb6377b1695fad
(Matthieu Moy) handle 'bzr diff' when not in a branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1171
1171
                raise BzrCommandError("Files are in different branches")
1172
1172
            file_list = None
1173
1173
        except NotBranchError:
1174
 
            # Don't raise an error when bzr diff is called from
1175
 
            # outside a working tree.
1176
 
            tree1, tree2 = None, None
 
1174
            if (revision is not None and len(revision) == 2
 
1175
                and not revision[0].needs_branch()
 
1176
                and not revision[1].needs_branch()):
 
1177
                # If both revision specs include a branch, we can
 
1178
                # diff them without needing a local working tree
 
1179
                tree1, tree2 = None, None
 
1180
            else:
 
1181
                raise
1177
1182
        if revision is not None:
1178
1183
            if tree2 is not None:
1179
1184
                raise BzrCommandError("Can't specify -r with two branches")