Zim

Auto-commit on close not working

Bug #1258092 reported by Alphazo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zim
Fix Released
High
Unassigned

Bug Description

Section about Version Control in the manual states:
"If the option Autosave version on regular intervals is enabled zim will save (or "commit") a new version every time you close zim
or when opening zim if new changes are detected."

I have enabled the Autosave feature under version control and see (git) auto-commit only to happen upon Zim start. No commit is ever done when Zime is closed. Is this the intended behavior?

Thanks
Alphazo

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 1258092] [NEW] Auto-commit on close not working

No, intention is that it is called on close, the call on start is a double
check to allow for outside modifications of the data.

Mayeb you can run "zim -D" to look if there is any git process call done at
close ?

On Thu, Dec 5, 2013 at 11:29 AM, Alphazo <email address hidden> wrote:

> Public bug reported:
>
> Section about Version Control in the manual states:
> "If the option Autosave version on regular intervals is enabled zim will
> save (or "commit") a new version every time you close zim
> or when opening zim if new changes are detected."
>
> I have enabled the Autosave feature under version control and see (git)
> auto-commit only to happen upon Zim start. No commit is ever done when
> Zime is closed. Is this the intended behavior?
>
> Thanks
> Alphazo
>
> ** Affects: zim
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to Zim.
> https://bugs.launchpad.net/bugs/1258092
>
> Title:
> Auto-commit on close not working
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zim/+bug/1258092/+subscriptions
>

Revision history for this message
Alphazo (alphazo) wrote :
Download full text (8.1 KiB)

I initially monitored git log to see if anything was add at close but couldn't see anything. Running in debug mode shows no commit upon notebook close (see below). BTW, I used a patched 674 version to get file autosave to work.

export LANG=en_US.UTF-8; zim -D
INFO: This is zim 0.60
DEBUG: Python version is sys.version_info(major=2, minor=7, micro=6, releaselevel='final', serial=0)
DEBUG: Platform is posix
DEBUG: Zim revision is:
  branch: zim-build
  revision: 674 <email address hidden>
  date: 2013-08-18 10:48:11 +0200
DEBUG: Not running from a source dir
DEBUG: Set XDG_DATA_HOME to /home/alpha/.local/share
DEBUG: Set XDG_DATA_DIRS to [<Dir: /usr/share>, <Dir: /usr/local/share>]
DEBUG: Set XDG_CONFIG_HOME to /home/alpha/.config
DEBUG: Set XDG_CONFIG_DIRS to [<Dir: /etc/xdg>]
DEBUG: Set XDG_CACHE_HOME to /home/alpha/.cache
DEBUG: Running command: gui
DEBUG: Loading config from: /home/alpha/Notebooks/Notes/notebook.zim
DEBUG: Loading config from: /home/alpha/zimtest2/notebook.zim
DEBUG: Loading config from: /home/alpha/zimtest3/notebook.zim
DEBUG: Wrote /home/alpha/.config/zim/notebooks.list
INFO: Opening default notebook
DEBUG: Remote call from 17327: <RemoteMethodCall: 17327: zim.ipc.Server(None).ping((), {})>
DEBUG: Starting server by spawning new process
INFO: Spawning: ['/usr/bin/python2', '/usr/bin/zim', '--ipc-server-main', '/tmp/zim-alpha/zim-server-socket', '10'] (cwd: None)
DEBUG: Process started with PID: 17329
DEBUG: Remote call from 17327: <RemoteMethodCall: 17327: zim.ipc.Server(None).ping((), {})>
INFO: Server starting 17329 at /tmp/zim-alpha/zim-server-socket
DEBUG: Remote call from 17327: <RemoteMethodCall: 17327: zim.ipc.Server(None).ping((), {})>
DEBUG: Remote call returned to 17327: ('ACK', 17329)
DEBUG: Remote call from 17327: <RemoteMethodCall: 17327: zim.ipc.Server(None).has_object((<RemoteObject: zim.gui.GtkInterface(file:///home/alpha/zimtest3)>,), {})>
DEBUG: Remote call returned to 17327: False
DEBUG: Remote call from 17327: <RemoteMethodCall: 17327: zim.ipc.Server(None).init_object((<RemoteObject: zim.gui.GtkInterface(file:///home/alpha/zimtest3)>,), {})>
DEBUG: Loading config from: <ConfigFile: /home/alpha/.config/zim/preferences.conf>
DEBUG: Gtk version is (2, 24, 22)
DEBUG: Pygtk version is (2, 24, 0)
WARNING: Could not find all icon sizes for the application icon
DEBUG: Loading config from: <ConfigFile: /home/alpha/.config/zim/style.conf>
DEBUG: Opening notebook: file:///home/alpha/zimtest3
DEBUG: Wrote <UnixFile: /home/alpha/zimtest3/.zim/tmp>
INFO: Remove file: <UnixFile: /home/alpha/zimtest3/.zim/tmp>
DEBUG: Loading config from: <UnixFile: /home/alpha/zimtest3/notebook.zim>
DEBUG: Cache dir: <Dir: /home/alpha/zimtest3/.zim>
DEBUG: Index database file: <UnixFile: /home/alpha/zimtest3/.zim/index.db>
DEBUG: Loading config from: <UnixFile: /home/alpha/zimtest3/.zim/state.conf>
DEBUG: Loaded plugin "arithmetic" (<ArithmeticPlugin object at 0x2b36a00 (zim+plugins+PluginClass at 0x2734b20)>)
DEBUG: Loaded plugin "attachmentbrowser" (<AttachmentBrowserPlugin object at 0x2b36aa0 (zim+plugins+PluginClass at 0x2734b00)>)
DEBUG: Loaded plugin "backlinkpane" (<BackLinksPanePlugin object at 0x2b36...

Read more...

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 1258092] Re: Auto-commit on close not working
Download full text (9.0 KiB)

Looking at this log, the plugin actually started to do the commit (the
"add" and "status" commands are run before the actual commit). But the
commit is in a separate thread, so could be that for some reason the
process quit before the final command was executed.

Need to look into the thread type if it is supposed to stay alive here or
not.

-- Jaap

On Thu, Dec 5, 2013 at 3:24 PM, Alphazo <email address hidden> wrote:

> I initially monitored git log to see if anything was add at close but
> couldn't see anything. Running in debug mode shows no commit upon
> notebook close (see below). BTW, I used a patched 674 version to get
> file autosave to work.
>
> export LANG=en_US.UTF-8; zim -D
> INFO: This is zim 0.60
> DEBUG: Python version is sys.version_info(major=2, minor=7, micro=6,
> releaselevel='final', serial=0)
> DEBUG: Platform is posix
> DEBUG: Zim revision is:
> branch: zim-build
> revision: 674 <email address hidden>
> date: 2013-08-18 10:48:11 +0200
> DEBUG: Not running from a source dir
> DEBUG: Set XDG_DATA_HOME to /home/alpha/.local/share
> DEBUG: Set XDG_DATA_DIRS to [<Dir: /usr/share>, <Dir: /usr/local/share>]
> DEBUG: Set XDG_CONFIG_HOME to /home/alpha/.config
> DEBUG: Set XDG_CONFIG_DIRS to [<Dir: /etc/xdg>]
> DEBUG: Set XDG_CACHE_HOME to /home/alpha/.cache
> DEBUG: Running command: gui
> DEBUG: Loading config from: /home/alpha/Notebooks/Notes/notebook.zim
> DEBUG: Loading config from: /home/alpha/zimtest2/notebook.zim
> DEBUG: Loading config from: /home/alpha/zimtest3/notebook.zim
> DEBUG: Wrote /home/alpha/.config/zim/notebooks.list
> INFO: Opening default notebook
> DEBUG: Remote call from 17327: <RemoteMethodCall: 17327:
> zim.ipc.Server(None).ping((), {})>
> DEBUG: Starting server by spawning new process
> INFO: Spawning: ['/usr/bin/python2', '/usr/bin/zim', '--ipc-server-main',
> '/tmp/zim-alpha/zim-server-socket', '10'] (cwd: None)
> DEBUG: Process started with PID: 17329
> DEBUG: Remote call from 17327: <RemoteMethodCall: 17327:
> zim.ipc.Server(None).ping((), {})>
> INFO: Server starting 17329 at /tmp/zim-alpha/zim-server-socket
> DEBUG: Remote call from 17327: <RemoteMethodCall: 17327:
> zim.ipc.Server(None).ping((), {})>
> DEBUG: Remote call returned to 17327: ('ACK', 17329)
> DEBUG: Remote call from 17327: <RemoteMethodCall: 17327:
> zim.ipc.Server(None).has_object((<RemoteObject:
> zim.gui.GtkInterface(file:///home/alpha/zimtest3)>,), {})>
> DEBUG: Remote call returned to 17327: False
> DEBUG: Remote call from 17327: <RemoteMethodCall: 17327:
> zim.ipc.Server(None).init_object((<RemoteObject:
> zim.gui.GtkInterface(file:///home/alpha/zimtest3)>,), {})>
> DEBUG: Loading config from: <ConfigFile:
> /home/alpha/.config/zim/preferences.conf>
> DEBUG: Gtk version is (2, 24, 22)
> DEBUG: Pygtk version is (2, 24, 0)
> WARNING: Could not find all icon sizes for the application icon
> DEBUG: Loading config from: <ConfigFile:
> /home/alpha/.config/zim/style.conf>
> DEBUG: Opening notebook: file:///home/alpha/zimtest3
> DEBUG: Wrote <UnixFile: /home/alpha/zimtest3/.zim/tmp>
> INFO: Remove file: <UnixFile: /home/alpha/zimtest3/.zim/tmp>
> DEBUG: Loading config from: <UnixFile: /home/alpha...

Read more...

Revision history for this message
Alphazo (alphazo) wrote :

For information, I tried to use a different backend (hg) and had the exact same issue with the auto-commit not happening when closing the notebook, only when re-opening it.

Revision history for this message
Alphazo (alphazo) wrote :

While trying to setup a bash script to auto-commit on exiting Zim I found the workaround to auto-commit by starting Zim with "zim --standalone". Looks like there is something wrong when the application is started as a separate process.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Yes, my guess is that the mulit-process version closes the child process
before the thread executing the version command is done.

On Mon, Dec 23, 2013 at 10:37 AM, Alphazo <email address hidden>wrote:

> While trying to setup a bash script to auto-commit on exiting Zim I
> found the workaround to auto-commit by starting Zim with "zim
> --standalone". Looks like there is something wrong when the application
> is started as a separate process.
>
> --
> You received this bug notification because you are subscribed to Zim.
> https://bugs.launchpad.net/bugs/1258092
>
> Title:
> Auto-commit on close not working
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zim/+bug/1258092/+subscriptions
>

Changed in zim:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Fixed in branch pyzim-refactor rev 706 - will merge after dog food testing

Changed in zim:
status: Confirmed → Fix Committed
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Fixed in release 0.61

Changed in zim:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.