Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'mb edit' can fail to parse edited content for empty lines #25

Closed
poeml opened this issue Jun 5, 2015 · 0 comments
Closed

'mb edit' can fail to parse edited content for empty lines #25

poeml opened this issue Jun 5, 2015 · 0 comments

Comments

@poeml
Copy link
Owner

poeml commented Jun 5, 2015

                                                                                 [          ]

Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue30

Title    'mb edit' can fail to parse edited content for empty lines
 Priority   bug                  Status          resolved
Superseder                      Nosy List        poeml
Assigned To poeml               Keywords

msg83 (view) Author: poeml Date: 2009-12-03.10:21:03

When editing a mirror record with 'mb edit', and removing the trailing space
after the colon of an empty variable, a parse failure will result when trying to
save the data.

This can happen if a complete mirror record is copy&pasted from somewhere else,
and trailing spaces get lost during this mouse action.

Traceback is:

Save changes?
y)es, n)o, e)dit again: y
Traceback (most recent call last):
File "/usr/bin/mb", line 1187, in
sys.exit( mirrordoctor.main() )
File "/var/lib/python-support/python2.5/cmdln.py", line 257, in main
return self.cmd(args)
File "/var/lib/python-support/python2.5/cmdln.py", line 280, in cmd
retval = self.onecmd(argv)
File "/var/lib/python-support/python2.5/cmdln.py", line 412, in onecmd
return self._dispatch_cmd(handler, argv)
File "/var/lib/python-support/python2.5/cmdln.py", line 1100, in _dispatch_cmd
return handler(argv[0], opts, *args)
File "/usr/bin/mb", line 516, in do_edit
if str(old_dict[i]) != new_dict[i]:
KeyError: 'publicNotes'

msg189 (view) Author: poeml Date: 2010-05-04.16:02:49

Another failure with copy and paste is this:

When copying output from commit diffs (captured via mb "mb export --commit=svn"),
statusBaseurl is missing in the output.

When pasting that output into "mb edit", mb edit will fail to save the entry for
this reason.

How to reproduce: run "mb edit", remove statusBaseurl line, and try to save.

msg190 (view) Author: poeml Date: 2010-05-04.16:47:01

Fixed in trunk, r8044.

msg206 (view) Author: poeml Date: 2010-09-01.16:34:37

I believe this is fixed.

About to appear in 2.13.0.

msg246 (view) Author: poeml Date: 2010-09-17.13:43:05

I believe that this fix caused a regression. It wasn't possible anymore to remove
an URL (setting the value to empty).

Fixed in trunk r8129.

http://svn.mirrorbrain.org/viewvc/mirrorbrain?view=revision&revision=8129

(To become available in 2.13.1.)

msg247 (view) Author: poeml Date: 2010-09-17.14:07:01

...and r8130.

It turned out that the original issue, reported here, wasn't working anymore.
r8130 now properly ignores the trailing space after the colon.

http://svn.mirrorbrain.org/viewvc/mirrorbrain?view=revision&revision=8130

History
         Date         User  Action              Args
2010-09-17 14:07:06 poeml set    status: chatting -> resolved
2010-09-17 14:07:01 poeml set    status: resolved -> chatting
                                   messages: + msg247
2010-09-17 13:43:12 poeml set    status: chatting -> resolved
2010-09-17 13:43:05 poeml set    status: resolved -> chatting
                                   messages: + msg246
2010-09-01 16:34:37 poeml set    status: testing -> resolved
                                   messages: + msg206
2010-05-04 16:47:02 poeml set    status: in-progress -> testing
                                   messages: + msg190
2010-05-04 16:02:49 poeml set    messages: + msg189
2009-12-07 03:15:02 poeml set    status: unread -> in-progress
2009-12-03 10:21:03 poeml create

(end of migrated issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant