~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-08-30 05:35:11 UTC
  • Revision ID: mbp@sourcefrog.net-20050830053511-71f6b3ba8ca93827
- add new Branch.set_parent and tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1297
1297
                    raise
1298
1298
        return None
1299
1299
 
 
1300
 
 
1301
    def set_parent(self, url):
 
1302
        # TODO: Maybe delete old location files?
 
1303
        from bzrlib.atomicfile import AtomicFile
 
1304
        self.lock_write()
 
1305
        try:
 
1306
            f = AtomicFile(self.controlfilename('parent'))
 
1307
            try:
 
1308
                f.write(url + '\n')
 
1309
                f.commit()
 
1310
            finally:
 
1311
                f.close()
 
1312
        finally:
 
1313
            self.unlock()
 
1314
 
1300
1315
        
1301
1316
 
1302
1317