diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-12-12 22:40:38 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-12-12 22:40:38 +0100 |
commit | f5470d08564391dfd0024cc9349463cafccb9f16 (patch) | |
tree | 36801524902290ae4b35dd85e39b58969a0c4709 | |
parent | 5504c59f2d8c8944703e4707250ab213d69e16f1 (diff) | |
download | distix-f5470d08564391dfd0024cc9349463cafccb9f16.tar.gz |
Change all write commands to require clean tree
-rw-r--r-- | distixlib/plugins/import_mail_plugin.py | 2 | ||||
-rw-r--r-- | distixlib/plugins/new_plugin.py | 1 | ||||
-rw-r--r-- | distixlib/plugins/reply_plugin.py | 1 | ||||
-rw-r--r-- | distixlib/plugins/set_plugin.py | 1 | ||||
-rw-r--r-- | yarns/070-search.yarn | 7 |
5 files changed, 9 insertions, 3 deletions
diff --git a/distixlib/plugins/import_mail_plugin.py b/distixlib/plugins/import_mail_plugin.py index ec37618..13bb5b0 100644 --- a/distixlib/plugins/import_mail_plugin.py +++ b/distixlib/plugins/import_mail_plugin.py @@ -47,6 +47,7 @@ class ImportMailPlugin(cliapp.Plugin): repo_dirname, mail_filename = self._parse_command_line(args) msg = self._read_mail_message(mail_filename) repo = distixlib.Repository(repo_dirname) + repo.require_clean_working_tree() ticket_store = repo.open_ticket_store(distixlib.tickets_dir_name) all_tickets = ticket_store.get_tickets() cache = _MessageIdCache() @@ -151,6 +152,7 @@ class ImportMailPlugin(cliapp.Plugin): repo_dirname, mbox_filename = self._parse_command_line(args) mbox = mailbox.mbox(mbox_filename) repo = distixlib.Repository(repo_dirname) + repo.require_clean_working_tree() ticket_store = repo.open_ticket_store(distixlib.tickets_dir_name) all_tickets = ticket_store.get_tickets() cache = _MessageIdCache() diff --git a/distixlib/plugins/new_plugin.py b/distixlib/plugins/new_plugin.py index 1c2effc..240289a 100644 --- a/distixlib/plugins/new_plugin.py +++ b/distixlib/plugins/new_plugin.py @@ -43,6 +43,7 @@ class NewTicketPlugin(cliapp.Plugin): title = args[0] repo = distixlib.Repository('.') + repo.require_clean_working_tree() ticket_id = repo.invent_new_ticket_id() ticket = self._create_ticket(ticket_id, title) ticket_store = repo.open_ticket_store(distixlib.tickets_dir_name) diff --git a/distixlib/plugins/reply_plugin.py b/distixlib/plugins/reply_plugin.py index b0ac25a..550a8f2 100644 --- a/distixlib/plugins/reply_plugin.py +++ b/distixlib/plugins/reply_plugin.py @@ -46,6 +46,7 @@ class ReplyPlugin(cliapp.Plugin): self.app.settings.require('message') repo = distixlib.Repository('.') + repo.require_clean_working_tree() ticket_store = repo.open_ticket_store(distixlib.tickets_dir_name) ticket_id = distixlib.get_ticket_ids(self.app.settings, args)[0] ticket = ticket_store.get_ticket(ticket_id) diff --git a/distixlib/plugins/set_plugin.py b/distixlib/plugins/set_plugin.py index ce10c7f..1fd99f2 100644 --- a/distixlib/plugins/set_plugin.py +++ b/distixlib/plugins/set_plugin.py @@ -35,6 +35,7 @@ class SetPlugin(cliapp.Plugin): '''Set ticket metadata.''' repo = distixlib.Repository('.') + repo.require_clean_working_tree() ticket_id = distixlib.get_ticket_ids(self.app.settings, args)[0] ticket_store = repo.open_ticket_store(distixlib.tickets_dir_name) ticket = ticket_store.get_ticket(ticket_id) diff --git a/yarns/070-search.yarn b/yarns/070-search.yarn index 0308327..ccbe471 100644 --- a/yarns/070-search.yarn +++ b/yarns/070-search.yarn @@ -21,10 +21,10 @@ First, create two tickets with different titles. THEN attempt succeeded WHEN user changes working directory to REPO - AND user attempts to run distix new first-ticket --save-ticket-id=T1 + AND user attempts to run distix new first-ticket --save-ticket-id=../T1 THEN attempt succeeded - WHEN user attempts to run distix new second-ticket --save-ticket-id=T2 + WHEN user attempts to run distix new second-ticket --save-ticket-id=../T2 THEN attempt succeeded Make sure `distix list` shows both tickets. @@ -37,7 +37,8 @@ Make sure `distix list` shows both tickets. Set the second ticket's state to closed, and make sure `distix list` still shows both tickets. - WHEN user attempts to run distix set --ticket-id-from=T2 DUMMY state=closed + WHEN user attempts to run + ... distix set --ticket-id-from=../T2 DUMMY state=closed THEN attempt succeeded WHEN user attempts to run distix list |