/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: Martin Pool
  • Date: 2008-07-21 07:48:30 UTC
  • mfrom: (3564 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3566.
  • Revision ID: mbp@sourcefrog.net-20080721074830-i1pgj2hswpfo6pav
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
 
23
23
def _show_push_branch(br_from, revision_id, location, to_file, verbose=False,
24
 
    overwrite=False, remember=False, reference=None, create_prefix=False,
 
24
    overwrite=False, remember=False, stacked_on=None, create_prefix=False,
25
25
    use_existing_dir=False):
26
26
    """Push a branch to a location.
27
27
 
34
34
        have diverged from the source, otherwise the push fails
35
35
    :param remember: if True, store the location as the push location for
36
36
        the source branch
37
 
    :param reference: the url of the branch, if any, to stack on;
 
37
    :param stacked_on: the url of the branch, if any, to stack on;
38
38
        if set, only the revisions not in that branch are pushed
39
39
    :param create_prefix: if True, create the necessary parent directories
40
40
        at the destination if they don't already exist
101
101
        # Now the target directory exists, but doesn't have a .bzr
102
102
        # directory. So we need to create it, along with any work to create
103
103
        # all of the dependent branches, etc.
104
 
        if reference is not None:
 
104
        if stacked_on is not None:
105
105
            # This should be buried in the clone method itself. TODO.
106
106
            try:
107
107
                # if the from format is stackable, this will either work or
114
114
            dir_to = br_from.bzrdir._format.initialize_on_transport(to_transport)
115
115
            br_from.repository._format.initialize(dir_to)
116
116
            br_to = br_from._format.initialize(dir_to)
117
 
            br_to.set_stacked_on_url(reference)
 
117
            br_to.set_stacked_on_url(stacked_on)
118
118
            # and copy the data up.
119
119
            br_from.push(br_to)
120
120
        else:
122
122
                revision_id=revision_id)
123
123
        br_to = dir_to.open_branch()
124
124
        # TODO: Some more useful message about what was copied
125
 
        if reference is not None:
126
 
            note('Created new stacked branch referring to %s.' % reference)
 
125
        if stacked_on is not None:
 
126
            note('Created new stacked branch referring to %s.' % stacked_on)
127
127
        else:
128
128
            note('Created new branch.')
129
129
        # We successfully created the target, remember it
140
140
    elif br_to is None:
141
141
        # We have a repository but no branch, copy the revisions, and then
142
142
        # create a branch.
143
 
        if reference is not None:
 
143
        if stacked_on is not None:
144
144
            warning("Ignoring request for a stacked branch as repository "
145
145
                    "already exists at the destination location.")
146
146
        repository_to.fetch(br_from.repository, revision_id=revision_id)
149
149
        if br_from.get_push_location() is None or remember:
150
150
            br_from.set_push_location(br_to.base)
151
151
    else: # We have a valid to branch
152
 
        if reference is not None:
 
152
        if stacked_on is not None:
153
153
            warning("Ignoring request for a stacked branch as branch "
154
154
                    "already exists at the destination location.")
155
155
        # We were able to connect to the remote location, so remember it.