~ian-clatworthy/ubuntu/lucid/bzr-loom/test-ppa

« back to all changes in this revision

Viewing changes to loom_state.py

  • Committer: Aaron Bentley
  • Date: 2008-04-24 16:13:06 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: aaron@aaronbentley.com-20080424161306-097q2zh3qcppae92
Allow combine-thread to delete the bottom thread (#194274)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Loom, a plugin for bzr to assist in developing focused patches.
2
 
# Copyright (C) 2006 Canonical Limited.
 
2
# Copyright (C) 2006, 2008 Canonical Limited.
3
3
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License version 2 as published
78
78
        except ValueError:
79
79
            raise NoSuchThread(self, thread)
80
80
 
81
 
    def get_previous_thread(self, current_thread):
 
81
    def get_new_thread_after_deleting(self, current_thread):
 
82
        if len(self._threads) == 1:
 
83
            return None
82
84
        current_index = self.thread_index(current_thread)
83
85
        if current_index == 0:
84
 
            return None
85
 
        return self._threads[current_index - 1][0]
 
86
            new_index = 1
 
87
        else:
 
88
            new_index = current_index - 1
 
89
        return self._threads[new_index][0]
86
90
 
87
91
    def set_parents(self, parent_list):
88
92
        """Set the parents of this state to parent_list.