~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

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
 
228
241
 
229
242
class ForeignBranch(Branch):
230
243
    """Branch that exists in a foreign version control system."""
259
272
 
260
273
 
261
274
class cmd_dpush(Command):
262
 
    __doc__ = """Push into a different VCS without any custom bzr metadata.
 
275
    """Push into a different VCS without any custom bzr metadata.
263
276
 
264
277
    This will afterwards rebase the local branch on the remote
265
278
    branch unless the --no-rebase option is used, in which case 
296
309
        except NoWorkingTree:
297
310
            source_branch = Branch.open(directory)
298
311
            source_wt = None
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.')
 
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.')
304
326
        stored_loc = source_branch.get_push_location()
305
327
        if location is None:
306
328
            if stored_loc is None: