~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/push.py

  • Committer: Aaron Bentley
  • Date: 2008-08-28 18:57:59 UTC
  • mto: This revision was merged to the branch mainline in revision 3678.
  • Revision ID: aaron@aaronbentley.com-20080828185759-fbc45dxmvt02c3a1
Fix push to use clone all the time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 stacked_on is not None:
105
 
            # This should be buried in the clone method itself. TODO.
106
 
            try:
107
 
                # if the from format is stackable, this will either work or
108
 
                # trigger NotStacked. If it's not, an error will be given to
109
 
                # the user.
110
 
                br_from.get_stacked_on_url()
111
 
            except errors.NotStacked:
112
 
                pass
113
 
            # now we need to sprout the repository,
114
 
            dir_to = br_from.bzrdir._format.initialize_on_transport(to_transport)
115
 
            br_from.repository._format.initialize(dir_to)
116
 
            br_to = br_from._format.initialize(dir_to)
117
 
            br_to.set_stacked_on_url(stacked_on)
118
 
            # and copy the data up.
119
 
            br_from.push(br_to)
120
 
        else:
121
 
            dir_to = br_from.bzrdir.clone_on_transport(to_transport,
122
 
                revision_id=revision_id)
 
104
        dir_to = br_from.bzrdir.clone_on_transport(to_transport,
 
105
            revision_id=revision_id, stacked_on=stacked_on)
123
106
        br_to = dir_to.open_branch()
124
107
        # TODO: Some more useful message about what was copied
125
108
        if stacked_on is not None: