~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Aaron Bentley
  • Date: 2005-10-01 05:57:36 UTC
  • mfrom: (1393.1.23)
  • mto: (1185.12.13)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051001055736-a1bb0acdce40852a
Merge from mpool

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
from bzrlib.revision import common_ancestor, MultipleRevisionSources
37
37
from bzrlib.errors import NoSuchRevision
38
38
 
 
39
# TODO: build_working_dir can be built on something simpler than merge()
 
40
 
 
41
# FIXME: merge() parameters seem oriented towards the command line
39
42
 
40
43
# comments from abentley on irc: merge happens in two stages, each
41
44
# of which generates a changeset object
271
274
            return self.cached[id]
272
275
 
273
276
 
 
277
def build_working_dir(to_dir):
 
278
    """Build a working directory in an empty directory.
 
279
 
 
280
    to_dir is a directory containing branch metadata but no working files,
 
281
    typically constructed by cloning an existing branch. 
 
282
 
 
283
    This is split out as a special idiomatic case of merge.  It could
 
284
    eventually be done by just building the tree directly calling into 
 
285
    lower-level code (e.g. constructing a changeset).
 
286
    """
 
287
    merge((to_dir, -1), (to_dir, 0), this_dir=to_dir,
 
288
          check_clean=False, ignore_zero=True)
 
289
 
274
290
 
275
291
def merge(other_revision, base_revision,
276
292
          check_clean=True, ignore_zero=False,
287
303
    check_clean
288
304
        If true, this_dir must have no uncommitted changes before the
289
305
        merge begins.
 
306
    ignore_zero - If true, suppress the "zero conflicts" message when 
 
307
        there are no conflicts; should be set when doing something we expect
 
308
        to complete perfectly.
290
309
 
291
310
    All available ancestors of other_revision and base_revision are
292
311
    automatically pulled into the branch.