~bzr/ubuntu/lucid/bzr/beta-ppa

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Martin Pool
  • Date: 2010-08-18 04:26:39 UTC
  • mfrom: (129.1.8 packaging-karmic)
  • Revision ID: mbp@sourcefrog.net-20100818042639-mjoxtngyjwiu05fo
* PPA rebuild for lucid.
* PPA rebuild for karmic.
* PPA rebuild onto jaunty.
* New upstream release.

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_inventory_sha1(self, revision_id):
233
 
        """Get the sha1 for the XML representation of an inventory.
234
 
 
235
 
        :param revision_id: Revision id of the inventory for which to return
236
 
         the SHA1.
237
 
        :return: XML string
238
 
        """
239
 
 
240
 
        return osutils.sha_string(self.get_inventory_xml(revision_id))
241
 
 
242
 
    def get_revision_xml(self, revision_id):
243
 
        """Return the XML representation of a revision.
244
 
 
245
 
        :param revision_id: Revision for which to return the XML.
246
 
        :return: XML string
247
 
        """
248
 
        return self._serializer.write_revision_to_string(
249
 
            self.get_revision(revision_id))
250
 
 
251
228
 
252
229
class ForeignBranch(Branch):
253
230
    """Branch that exists in a foreign version control system."""
282
259
 
283
260
 
284
261
class cmd_dpush(Command):
285
 
    """Push into a different VCS without any custom bzr metadata.
 
262
    __doc__ = """Push into a different VCS without any custom bzr metadata.
286
263
 
287
264
    This will afterwards rebase the local branch on the remote
288
265
    branch unless the --no-rebase option is used, in which case 
319
296
        except NoWorkingTree:
320
297
            source_branch = Branch.open(directory)
321
298
            source_wt = None
322
 
        if strict is None:
323
 
            strict = source_branch.get_config(
324
 
                ).get_user_option_as_bool('dpush_strict')
325
 
        if strict is None: strict = True # default value
326
 
        if strict and source_wt is not None:
327
 
            if (source_wt.has_changes()):
328
 
                raise errors.UncommittedChanges(
329
 
                    source_wt, more='Use --no-strict to force the push.')
330
 
            if source_wt.last_revision() != source_wt.branch.last_revision():
331
 
                # The tree has lost sync with its branch, there is little
332
 
                # chance that the user is aware of it but he can still force
333
 
                # the push with --no-strict
334
 
                raise errors.OutOfDateTree(
335
 
                    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.')
336
304
        stored_loc = source_branch.get_push_location()
337
305
        if location is None:
338
306
            if stored_loc is None: