~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testfetch.py

  • Committer: Martin Pool
  • Date: 2005-09-13 09:06:10 UTC
  • Revision ID: mbp@sourcefrog.net-20050913090610-7ce557143a7ca17a
- remove a lot of dead code from fetch

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
 
 
17
import sys
 
18
import os
 
19
 
16
20
import bzrlib.errors
17
21
from bzrlib.selftest.testrevision import make_branches
18
22
from bzrlib.trace import mutter
19
23
from bzrlib.branch import Branch
20
 
import sys
21
 
import os
 
24
from bzrlib.fetch import greedy_fetch
22
25
 
23
26
from bzrlib.selftest import TestCaseInTempDir
24
27
        
25
28
 
 
29
def has_revision(branch, revision_id):
 
30
    try:
 
31
        branch.get_revision_xml_file(revision_id)
 
32
        return True
 
33
    except bzrlib.errors.NoSuchRevision:
 
34
        return False
 
35
 
 
36
 
 
37
 
26
38
class TestFetch(TestCaseInTempDir):
27
39
    def runTest(self):
28
 
        from bzrlib.fetch import greedy_fetch, has_revision
29
 
 
30
40
        def new_branch(name):
31
41
            os.mkdir(name)
32
42
            return Branch(name, init=True)