Merge lp://qastaging/~przemub/rednotebook/lock-journal into lp://qastaging/~jendrikseipp/rednotebook/trunk

Proposed by Przemysław Buczkowski
Status: Needs review
Proposed branch: lp://qastaging/~przemub/rednotebook/lock-journal
Merge into: lp://qastaging/~jendrikseipp/rednotebook/trunk
Diff against target: 151 lines (+84/-1)
5 files modified
rednotebook/files/main_window.glade (+29/-0)
rednotebook/gui/main_window.py (+13/-0)
rednotebook/journal.py (+12/-0)
rednotebook/storage.py (+3/-1)
rednotebook/util/filesystem.py (+27/-0)
To merge this branch: bzr merge lp://qastaging/~przemub/rednotebook/lock-journal
Reviewer Review Type Date Requested Status
Przemysław Buczkowski (community) Disapprove
Jendrik Seipp Needs Fixing
Review via email: mp+233637@code.qastaging.launchpad.net

Description of the change

Hello!

This is a proposition to solve bug #974590. The program now checks is a lock file existing in the journal directory. The lock file (.pid.lock) is created at the opening time and removed while the journal is changed or the RedNotebook instance is closed.

It doesn't watch have the journal files been modified externally, because I see point neither in modifing them outside RedNotebook nor in using two instances at once.

PS. Sorry for posting it twice. I don't understand both Bazaar and Launchpad sufficiently yet :-)

To post a comment you must log in.
Revision history for this message
Jendrik Seipp (jendrikseipp) wrote :

Thanks for the patch! Actually this solution (a file lock) was used in RedNotebook once. Unfortunately, it caused many false-positives, i.e. the user was prompted with "Your Journal is still open" when actually the lock just hadn't been removed. This can happen if the system crashes while RedNotebook is running or if RedNotebook itself has a bug that causes a crash.

I think a better solution would be to warn the user once he wants to save a month file that has changed while he opened it (we would have to save the time of opening the file). Then he should be presented with the differences and be able to decide if he wants to merge the changes or just keep one of the versions. This would also allow to use multiple copies of RedNotebook (which is actually useful, because people often use multiple journals).

review: Needs Fixing
Revision history for this message
Przemysław Buczkowski (przemub) wrote :

Oh, I see. I think I'll be working on it in another branch then. Thanks for reviewing.

review: Disapprove

Unmerged revisions

1421. By Przemysław Buczkowski

create and detect the lock files for the journals

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: