From 4993a04394079cb94e8d14423cbbaeda63882780 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Tue, 15 Sep 2009 01:51:38 -0700 Subject: [PATCH] models.main: Add mode states This will let us know when we're in special states such as diff-mode. Signed-off-by: David Aguilar --- cola/models/main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cola/models/main.py b/cola/models/main.py index 0f2234b7..f84a8489 100644 --- a/cola/models/main.py +++ b/cola/models/main.py @@ -123,6 +123,24 @@ class MainModel(ObservableModel): # Observable messages message_updated = 'updated' message_about_to_update = 'about_to_update' + + # States + mode_none = 'none' # Default: nothing's happened, do nothing + mode_worktree = 'worktree' # Comparing index to worktree + mode_index = 'index' # Comparing index to last commit + mode_amend = 'amend' # Amending a commit + mode_grep = 'grep' # We ran Search -> Grep + mode_branch = 'branch' # Applying changes from a branch + mode_diff = 'diff' # Diffing against an arbitrary branch + mode_diff_expr = 'diff_expr' # Diffing using arbitrary expression + mode_review = 'review' # Reviewing a branch + + # Modes where we don't do anything like staging, etc. + modes_read_only = (mode_branch, mode_grep, + mode_diff, mode_diff_expr, mode_review) + # Modes where we can checkout files from the $head + modes_undoable = (mode_none, mode_index, mode_worktree) + def __init__(self, cwd=None): """Reads git repository settings and sets several methods so that they refer to the git module. This object -- 2.11.4.GIT