~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Marius Kruger
  • Date: 2010-07-10 21:28:56 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710212856-uq4ji3go0u5se7hx
* Update documentation
* add NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
        """Get the default mapping for this repository."""
226
226
        raise NotImplementedError(self.get_default_mapping)
227
227
 
228
 
    def _get_inventory_xml(self, revision_id):
229
 
        """See Repository._get_inventory_xml()."""
230
 
        return self._serialise_inventory(self.get_inventory(revision_id))
231
 
 
232
 
    def get_revision_xml(self, revision_id):
233
 
        """Return the XML representation of a revision.
234
 
 
235
 
        :param revision_id: Revision for which to return the XML.
236
 
        :return: XML string
237
 
        """
238
 
        return self._serializer.write_revision_to_string(
239
 
            self.get_revision(revision_id))
240
 
 
241
228
 
242
229
class ForeignBranch(Branch):
243
230
    """Branch that exists in a foreign version control system."""
272
259
 
273
260
 
274
261
class cmd_dpush(Command):
275
 
    """Push into a different VCS without any custom bzr metadata.
 
262
    __doc__ = """Push into a different VCS without any custom bzr metadata.
276
263
 
277
264
    This will afterwards rebase the local branch on the remote
278
265
    branch unless the --no-rebase option is used, in which case 
309
296
        except NoWorkingTree:
310
297
            source_branch = Branch.open(directory)
311
298
            source_wt = None
312
 
        if strict is None:
313
 
            strict = source_branch.get_config(
314
 
                ).get_user_option_as_bool('dpush_strict')
315
 
        if strict is None: strict = True # default value
316
 
        if strict and source_wt is not None:
317
 
            if (source_wt.has_changes()):
318
 
                raise errors.UncommittedChanges(
319
 
                    source_wt, more='Use --no-strict to force the push.')
320
 
            if source_wt.last_revision() != source_wt.branch.last_revision():
321
 
                # The tree has lost sync with its branch, there is little
322
 
                # chance that the user is aware of it but he can still force
323
 
                # the push with --no-strict
324
 
                raise errors.OutOfDateTree(
325
 
                    source_wt, more='Use --no-strict to force the push.')
 
299
        if source_wt is not None:
 
300
            source_wt.check_changed_or_out_of_date(
 
301
                strict, 'dpush_strict',
 
302
                more_error='Use --no-strict to force the push.',
 
303
                more_warning='Uncommitted changes will not be pushed.')
326
304
        stored_loc = source_branch.get_push_location()
327
305
        if location is None:
328
306
            if stored_loc is None: