/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Gary van der Merwe
  • Date: 2009-09-28 18:44:24 UTC
  • mto: (0.152.66 trunk)
  • mto: This revision was merged to the branch mainline in revision 6649.
  • Revision ID: garyvdm@gmail.com-20090928184424-y5hs2kcyn7xd5rwk
If there has not been an upload, treat the uploaded revid as revision.NULL_REVISION. This enables this request to be cached.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
    osutils,
154
154
    urlutils,
155
155
    workingtree,
 
156
    revision
156
157
    )
157
158
""")
158
159
 
254
255
    def get_uploaded_revid(self):
255
256
        if self._uploaded_revid is None:
256
257
            revid_path = get_upload_revid_location(self.branch)
257
 
            self._uploaded_revid = self.to_transport.get_bytes(revid_path)
 
258
            try:
 
259
                self._uploaded_revid = self.to_transport.get_bytes(revid_path)
 
260
            except errors.NoSuchFile:
 
261
                # We have not upload to here.
 
262
                self._uploaded_revid = revision.NULL_REVISION
258
263
        return self._uploaded_revid
259
264
 
260
265
    def upload_file(self, relpath, id, mode=None):
392
397
    def upload_tree(self):
393
398
        # If we can't find the revid file on the remote location, upload the
394
399
        # full tree instead
395
 
        try:
396
 
            rev_id = self.get_uploaded_revid()
397
 
        except errors.NoSuchFile:
 
400
        rev_id = self.get_uploaded_revid()
 
401
        
 
402
        if rev_id == revision.NULL_REVISION:
398
403
            if not self.quiet:
399
404
                self.outf.write('No uploaded revision id found,'
400
405
                                ' switching to full upload\n')