~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-07-16 00:07:40 UTC
  • mfrom: (909.1.5)
  • Revision ID: mbp@sourcefrog.net-20050716000740-f2dcb8894a23fd2d
- merge aaron's bugfix branch
  up to abentley@panoramicfeedback.com-20050715134354-78f2bca607acb415

Show diffs side-by-side

added added

removed removed

Lines of Context:
594
594
        import tempfile
595
595
        cache_root = tempfile.mkdtemp()
596
596
 
597
 
        if revision is not None:
598
 
            if len(revision) > 1:
599
 
                raise BzrCommandError('bzr branch --revision takes exactly 1 revision value')
600
 
        else:
 
597
        if revision is None:
601
598
            revision = [None]
 
599
        elif len(revision) > 1:
 
600
            raise BzrCommandError('bzr branch --revision takes exactly 1 revision value')
 
601
 
602
602
        try:
603
603
            try:
604
604
                br_from = find_cached_branch(from_location, cache_root)
628
628
            br_to.set_root_id(br_from.get_root_id())
629
629
 
630
630
            if revision:
631
 
                revno = br_to.lookup_revision(revision[0])
 
631
                if revision[0] is None:
 
632
                    revno = br_from.revno()
 
633
                else:
 
634
                    revno, rev_id = br_from.get_revision_info(revision[0])
632
635
                try:
633
636
                    br_to.update_revisions(br_from, stop_revision=revno)
634
637
                except NoSuchRevision: