~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 20:39:22 UTC
  • mto: (1185.11.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050711203922-ca56a0649529a83f
Adding a Branch.base property, removing pull_loc()

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
        cache_root = tempfile.mkdtemp()
546
546
        from bzrlib.branch import DivergedBranches
547
547
        br_from = find_branch(location)
548
 
        location = pull_loc(br_from)
 
548
        location = br_from.base
549
549
        old_revno = br_to.revno()
550
550
        try:
551
551
            from branch import find_cached_branch, DivergedBranches
552
552
            br_from = find_cached_branch(location, cache_root)
553
 
            location = pull_loc(br_from)
 
553
            location = br_from.base
554
554
            old_revno = br_to.revno()
555
555
            try:
556
556
                br_to.update_revisions(br_from)
588
588
        import tempfile
589
589
        cache_root = tempfile.mkdtemp()
590
590
 
591
 
        if revision is not None:
 
591
        if revision is None:
 
592
            revision = [None]
 
593
        else:
592
594
            if len(revision) > 1:
593
595
                raise BzrCommandError('bzr branch --revision takes exactly 1 revision value')
594
596
        try:
627
629
                raise BzrCommandError(msg)
628
630
            merge((to_location, -1), (to_location, 0), this_dir=to_location,
629
631
                  check_clean=False, ignore_zero=True)
630
 
            from_location = pull_loc(br_from)
 
632
            from_location = br_from.base
631
633
            br_to.controlfile("x-pull", "wb").write(from_location + "\n")
632
634
        finally:
633
635
            rmtree(cache_root)
634
636
 
635
637
 
636
 
def pull_loc(branch):
637
 
    # TODO: Should perhaps just make attribute be 'base' in
638
 
    # RemoteBranch and Branch?
639
 
    if hasattr(branch, "baseurl"):
640
 
        return branch.baseurl
641
 
    else:
642
 
        return branch.base
643
 
 
644
 
 
645
 
 
646
638
class cmd_renames(Command):
647
639
    """Show list of renamed files.
648
640
 
877
869
    def run(self, filename=None):
878
870
        """Print the branch root."""
879
871
        b = find_branch(filename)
880
 
        print b._transport.base
 
872
        print b.base
881
873
 
882
874
 
883
875
class cmd_log(Command):