~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2007-06-19 14:49:06 UTC
  • mto: This revision was merged to the branch mainline in revision 2537.
  • Revision ID: abentley@panoramicfeedback.com-20070619144906-zx160g6h377j729h
Fix handling of null revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
2551
2551
    
2552
2552
    @display_command
2553
2553
    def run(self, branch, other):
2554
 
        from bzrlib.revision import MultipleRevisionSources
 
2554
        from bzrlib.revision import ensure_null, MultipleRevisionSources
2555
2555
        
2556
2556
        branch1 = Branch.open_containing(branch)[0]
2557
2557
        branch2 = Branch.open_containing(other)[0]
2558
2558
 
2559
 
        last1 = branch1.last_revision()
2560
 
        last2 = branch2.last_revision()
 
2559
        last1 = ensure_null(branch1.last_revision())
 
2560
        last2 = ensure_null(branch2.last_revision())
2561
2561
 
2562
2562
        graph = branch1.repository.get_graph(branch2.repository)
2563
2563
        base_rev_id = graph.find_unique_lca(last1, last2)
3538
3538
 
3539
3539
    def run(self, submit_branch=None, public_branch=None, patch_type='bundle',
3540
3540
            sign=False, revision=None, mail_to=None, message=None):
 
3541
        from bzrlib.revision import ensure_null, NULL_REVISION
3541
3542
        if patch_type == 'plain':
3542
3543
            patch_type = None
3543
3544
        branch = Branch.open('.')
3568
3569
                revision_id = revision[0].in_history(branch).rev_id
3569
3570
        else:
3570
3571
            revision_id = branch.last_revision()
 
3572
        revision_id = ensure_null(revision_id)
 
3573
        if revision_id == NULL_REVISION:
 
3574
            raise errors.BzrCommandError('No revisions to bundle.')
3571
3575
        directive = merge_directive.MergeDirective.from_objects(
3572
3576
            branch.repository, revision_id, time.time(),
3573
3577
            osutils.local_time_offset(), submit_branch,