~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Martin Pool
  • Date: 2005-06-06 04:47:33 UTC
  • Revision ID: mbp@sourcefrog.net-20050606044733-e902b05ac1747cd2
- fix invocation of testbzr when giving explicit bzr location

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
                self.cached[id] = path
156
156
            return self.cached[id]
157
157
 
158
 
 
159
 
 
160
 
def merge(other_revision, base_revision,
161
 
          check_clean=True, ignore_zero=False,
162
 
          this_dir=None):
163
 
    """Merge changes into a tree.
164
 
 
165
 
    base_revision
166
 
        Base for three-way merge.
167
 
    other_revision
168
 
        Other revision for three-way merge.
169
 
    this_dir
170
 
        Directory to merge changes into; '.' by default.
171
 
    check_clean
172
 
        If true, this_dir must have no uncommitted changes before the
173
 
        merge begins.
174
 
    """
 
158
def merge(other_revision, base_revision, no_changes=True, ignore_zero=False):
175
159
    tempdir = tempfile.mkdtemp(prefix="bzr-")
176
160
    try:
177
 
        if this_dir is None:
178
 
            this_dir = '.'
179
 
        this_branch = find_branch(this_dir)
180
 
        if check_clean:
 
161
        this_branch = find_branch('.') 
 
162
        if no_changes:
181
163
            changes = compare_trees(this_branch.working_tree(), 
182
164
                                    this_branch.basis_tree(), False)
183
165
            if changes.has_changed():
226
208
 
227
209
def merge_inner(this_branch, other_tree, base_tree, tempdir, 
228
210
                ignore_zero=False):
229
 
    this_tree = get_tree((this_branch.base, None), tempdir, "this")[1]
 
211
    this_tree = get_tree(('.', None), tempdir, "this")[1]
230
212
 
231
213
    def get_inventory(tree):
232
214
        return tree.inventory