~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-11 22:40:57 UTC
  • mto: (1185.11.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050711224057-d1379fec7cd93b3d
Fixing some store stuff so that 'bzr branch' works.

Show diffs side-by-side

added added

removed removed

Lines of Context:
576
576
 
577
577
    def run(self, from_location, to_location=None, revision=None):
578
578
        import errno
 
579
        from shutil import rmtree
579
580
        from bzrlib.merge import merge
580
581
        from bzrlib.branch import DivergedBranches, NoSuchRevision, \
581
582
             find_branch
613
614
                    raise
614
615
            br_to = find_branch(to_location, init=True)
615
616
 
616
 
            revno = br_from.lookup_revision(revision[0])
 
617
            revno, rev_id = br_from.get_revision_info(revision[0])
617
618
            try:
618
619
                br_to.update_revisions(br_from, stop_revision=revno)
619
620
            except NoSuchRevision:
620
621
                rmtree(to_location)
621
 
                msg = "The branch %s has no revision %d." % (from_location,
 
622
                msg = "The branch %s has no revision %s." % (from_location,
622
623
                                                             revno)
623
624
                raise BzrCommandError(msg)
624
625
            merge((to_location, -1), (to_location, 0), this_dir=to_location,
627
628
            br_to.put_controlfile('x-pull', from_location+'\n')
628
629
        finally:
629
630
            if br_from and br_from.cache_root is not None:
630
 
                import shutil
631
 
                shutil.rmtree(br_from.cache_root)
 
631
                rmtree(br_from.cache_root)
632
632
                br_from.cache_root = None
633
633
 
634
634