/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 bzrlib/smart/branch.py

  • Committer: Andrew Bennetts
  • Date: 2008-06-19 02:51:12 UTC
  • mto: (3452.2.9 inter-remote-pack)
  • mto: This revision was merged to the branch mainline in revision 3511.
  • Revision ID: andrew.bennetts@canonical.com-20080619025112-wf4jpdp25lqk422y
Rename Branch.set_last_revision_descendant verb to Branch.set_last_revision_ex.  It's a cop out, but at least it's not misleading.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
        return SuccessfulSmartServerResponse(('ok',))
129
129
 
130
130
 
131
 
class SmartServerBranchRequestSetLastRevisionDescendant(SmartServerLockedBranchRequest):
132
 
    """New in 1.6."""
 
131
class SmartServerBranchRequestSetLastRevisionEx(SmartServerLockedBranchRequest):
133
132
    
134
133
    def do_with_locked_branch(self, branch, new_last_revision_id,
135
134
            allow_divergence, do_not_overwrite_descendant):
 
135
        """Set the last revision of the branch.
 
136
 
 
137
        New in 1.6.
 
138
        
 
139
        :param new_last_revision_id: the revision ID to set as the last
 
140
            revision of the branch.
 
141
        :param allow_divergence: A flag.  If non-zero, change the revision ID
 
142
            even if the new_last_revision_id's ancestry has diverged from the
 
143
            current last revision.  If zero, a 'Diverged' error will be
 
144
            returned if new_last_revision_id is not a descendant of the current
 
145
            last revision.
 
146
        :param do_not_overwrite_descendant:  A flag.  If non-zero and
 
147
            new_last_revision_id is not a descendant of the current last
 
148
            revision, then the last revision will not be changed.
 
149
 
 
150
        :returns: on success, a tuple of ('ok', revno, revision_id), where
 
151
            revno and revision_id are the new values of the current last
 
152
            revision info.  The revision_id might be different to the
 
153
            new_last_revision_id if do_not_overwrite_descendant was set.
 
154
        """
136
155
        try:
137
156
            last_revno, last_rev = branch.last_revision_info()
138
157
            graph = branch.repository.get_graph()