~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

- refactor handling of short option names

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
            self.pb.clear()
112
112
 
113
113
    def _fetch_revisions(self, last_revision):
114
 
        self.last_revision = self._find_last_revision(last_revision)
 
114
        try:
 
115
            self.last_revision = self._find_last_revision(last_revision)
 
116
        except NoSuchRevision, e:
 
117
            mutter('failed getting last revision: %s', e)
 
118
            raise InstallFailed([last_revision])
115
119
        mutter('fetch up to rev {%s}', self.last_revision)
116
120
        if (self.last_revision is not None and 
117
121
            self.to_branch.has_revision(self.last_revision)):
130
134
 
131
135
        Returns the revision_id, or returns None if there's no history
132
136
        in the source branch."""
133
 
        if last_revision:
134
 
            return last_revision
135
137
        self.pb.update('get source history')
136
138
        from_history = self.from_branch.revision_history()
137
139
        self.pb.update('get destination history')
138
 
        if from_history:
 
140
        if last_revision:
 
141
            self.from_branch.get_revision(last_revision)
 
142
            return last_revision
 
143
        elif from_history:
139
144
            return from_history[-1]
140
145
        else:
141
146
            return None                 # no history in the source branch