~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-16 07:38:10 UTC
  • Revision ID: mbp@sourcefrog.net-20050916073810-1f358be198c9ed91
- fix bug in committing files that are renamed but not modified

- add test for this

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
 
    def runTest(self):
28
 
        from bzrlib.fetch import greedy_fetch, has_revision
29
 
 
 
39
    def SKIPPED_old_test_fetch(self):
 
40
        """obsolete: new commit code depends on parents being present
 
41
        so the test data no longer suits this test."""
 
42
        
30
43
        def new_branch(name):
31
44
            os.mkdir(name)
32
45
            return Branch(name, init=True)
92
105
 
93
106
if __name__ == '__main__':
94
107
    import unittest
95
 
    sys.exit(unittest.run_suite(unittest.makeSuite()))
 
108
    unittest.main()
 
109