Skip to content

Commit 8a8a492

Browse files
committed
fix: roundup-demo, interactive mode would nuke an existing tracker.
Tonu Mikk demonstrated a bug in roundup-demo. When invoked without a tracker home on the command line, it would nuke an existing directory specified interactively. There is still a minor bug. If an invalid home directory is specified, roundup-demo will prompt for the template to use before reporting: Error: Refusing to nuke non-tracker directory: but this doesn't cause data loss so not worth fixing at this time.
1 parent 29be6e1 commit 8a8a492

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Fixed:
8181
is used to install the share tree. The lets Roundup find tracker
8282
templates and translation files. (Found by Simon Eigeldinger, fix
8383
John Rouillard)
84+
- fix roundup-demo, interactive mode would nuke an existing tracker.
85+
(Found Tonu Mikk, fix John Rouillard)
8486

8587
Features:
8688

roundup/scripts/roundup_demo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ def run():
138138
template = cli_args.template or DEFAULT_TEMPLATE
139139
backend = cli_args.backend_db or cli_backend or DEFAULT_BACKEND
140140

141+
if not tracker_home:
142+
home = my_input(
143+
_('Enter directory path to create demo tracker [%s]: ') % home)
144+
if not home:
145+
home = DEFAULT_HOME
146+
141147
# if there is no tracker in home, force nuke
142148
try:
143149
instance.open(home)
@@ -151,12 +157,6 @@ def run():
151157
# FIXME: i'd like to have an option to abort the tracker creation
152158
# say, by entering a single dot. but i cannot think of
153159
# appropriate prompt for that.
154-
if not tracker_home:
155-
home = my_input(
156-
_('Enter directory path to create demo tracker [%s]: ') % home)
157-
if not home:
158-
home = DEFAULT_HOME
159-
160160
if not cli_args.template in templates:
161161
template = my_input(
162162
_('Enter tracker template to use (one of (%(template_list)s)) [%(default_template)s]: ') %

0 commit comments

Comments
 (0)