Re: [Zim-wiki] Subversion support

2008-10-25 Thread Jaap Karssenberg
Ok, fixed most issues that Rui found with the subversion support. Only 
remaining item is that empty directories do not cleaned up. Reason is 
the ".svn" that remains there. I think svn gets confused when I just go 
ahead and delete that meta diretory, so no idea how to fix that one :(


But apart from that subversion support should now work as expected.

I also fixed a bug that would slow down indexing the tree for both
svn and bzr support. This was the slowdown when building the side pane.

Another -completely unrelated- feature that just got in is the checkbox 
list.
A screenshot of how this looks can be found here: 
http://launchpadlibrarian.net/18889235/2008-10-25-181254_449x393_scrot.png 
. It is not yet completely finished, but it starts to be usable.


Think we are all set for a release in 2 or 3 weeks. I will send out 
another announcement when messages are ready for translation.


Regards,

Jaap

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] Subversion support

2008-10-14 Thread Rui Nibau
Hi Jaap, hi all.

Le mardi 14 octobre 2008 à 12:11 +0200, Jaap Karssenberg a écrit :

> Hmm, this will be tricky, because it has to match the exact
> localization of the installed subversion version. Problem is that
> although svn prints an error it does not return an error code I can
> detect.
> 
> Is there an alternative svn command to query existence of the url ? Or
> should I just call mkdir and assume the location exists when it fails
> ?
> 
> Action item #2: fix detection of existence of repository directory
> 

Don't know, maybe using the list sub-command.

Say the user enters an url : URL

To check if this it exists, you can make :

svn list URL

If the url exists, the sub-command will list the corresponding content :

- If the url is a repo, it could be something like this :

project1/
project2/
etc.

- If the url is a folder in a repo, it will output the content of the
folder :

page1
page2
folder1/
etc.

- If the url doesn't exist, the sub-command will output a message like
that :

svn: [whatever] 'URL' [whatever]

So, this message could be matched against a regex, depending exclusively
on the url entered by the user.

> > Note : url field
> > ..
> 
> Correct, but I put it there just to hint the user that an full URL is 
> expected.
> 

Right. 

> 
> The wanted behavior of revert is that the specified version is rolled
> back and committed to the repository as a new version. Will it work
> that way with this command ? What is the difference / advantage over
> using svn cat ?

Well, i clearly don't know if 'svn update' is more efficient than 'svn
cat', i never use it : each time i have to revert a file to a previous
version, i use svn update.

With 'svn update foo.txt -r X', the foo.txt file in your working copy
(the zim notebook) is replaced by the foo.txt you commited into the
repository at revision X.

Use case with a foo.txt file

- edit -> commit -> foo.txt r1
- edit -> commit -> foo.txt r2
- edit -> commit -> foo.txt r3

1. You edit the file but you make mistakes : you want to come back to
the last committed version :

svn revert foo.txt

You have now foo.txt r3 in your working copy.
(bzr equivalent : bzr revert foo.txt)

2. You edit the file but you make mistakes, and you see that there's
also mistakes in the last commit (r3), so you want to revert the file to
a previous version :

svn update -r 2 foo.txt

Now, foo.txt in your working copy is an exact copy of foo.txt r2
(bzr equivalent : bzr revert -r 2 foo.txt)

If you commit without editing (commit -> foo.txt r4), foo.txt r4 will be
the same as foo.txt r2.

I think it's the behaviour you want to implement...

There is no equivalent of the uncommit command in bzr (as i know).

> > About focus on windows
>
> I have seen this before, but only on windows. Probably a combination
> of gtk and or specific window manager.
> 
> Please open a bug report for this and include first part of the zim -V
> output were it gives the gtk version numbers etc.

I also see this kind of behaviour with gtk apps on Windows (Geany).

I opened a bug report.

Thanks.

regards,

-- 
Rui Nibau <[EMAIL PROTECTED]>
Développeur web, rédacteur scientifique
http://www.omacronides.com
http://www.framasoft.net



___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] Subversion support

2008-10-14 Thread Jaap Karssenberg
Hi Rui,

Thanks for your detailed testing. Action items for me and general
comments below.

On Sat, Oct 11, 2008 at 9:25 PM, Rui Nibau <[EMAIL PROTECTED]> wrote:
> All tests above are made with the latest Zim snapshot (0.26) provide by
> Jaap in the tmp folder, under Ubuntu 8.04, with subversion version 1.5.1
> (r32289), bazaar 1.3.1.
>
> About subversion
... 8< ...
> 1. Project already versioned
... 8< ...
> Too much work for a problem that isn't really annoying and that
> shouldn't be really common. A user warning on the manual should be
> enough.

Action item #1: note about svn:ignore in the user manual

> 2. Start versioning with Zim
> 
>
> I create a Zim notebook with a couple of pages, then try to version it.
>
> 2.1. Start versioning ... KO
>
> Importing the notebook doesn't work i f the folder in the repos doesn't
> exist.
>
> In the init function, you check if svn info output contains "(Not a
> valid URL)" (line 74). In my operating system (french), the svn info
> command returns a string containing "(URL non valide)". Seems that test
> string should be localized.

Hmm, this will be tricky, because it has to match the exact
localization of the installed subversion version. Problem is that
although svn prints an error it does not return an error code I can
detect.

Is there an alternative svn command to query existence of the url ? Or
should I just call mkdir and assume the location exists when it fails
?

Action item #2: fix detection of existence of repository directory

> Note : url field
> ..
>
> In the repository dialog window : maybe the 'http' it's not really
> necessary for the url field, since you can also connect to a svn repos
> with "file://" or 'svn://' protocols.

Correct, but I put it there just to hint the user that an full URL is expected.

> 3. Working with a versionned notebook
> 
... 8< ...
> 3.5.remove a page in a namespace then commit .. ~ OK
>
>If the namespace is empty, the folder itself isn't deleted. So,
>if i delete 'page1-1' and commit, the folder 'page1' is still
>in the repos.
>
>It could be annoying if users have the habit to delete a lot of
>namespaces.

Action item #3: check why cleaning up of empty folders does not work

>
> 3.6.rename a namespace .. OK
>
> 3.7.Restore a previous version of a page  KO
>
>The restore function doesn't seem to work. Here's Zim output :
>
>## dispatch Versions:  (Zim::GUI)
>## AUTOLOAD Zim::GUI::VersionsDialog
># svn log "/home/[login]/zim_svn/project1/page1.txt"
># svn cat "-r" 5 "/home/[login]/zim_svn/project1/page1.txt"
>*** unhandled exception in callback:
>***   Can't locate object method "new" via package
> "Zmi::FS::File" (perhaps you forgot to load "Zmi::FS::File"?)
> at /usr/local/share/perl/5.8.8/Zim/FS/Subversion.pm line 130.
>***  ignoring at /usr/local/bin/zim line 332.

Action item #4: fix typo in the code Zmi -> Zim ... :S

>In the 'revert' function (Subversion.pm) that you try to use
>the 'revert' svn command or simply rewrite the file with the
>output of the 'cat' svn command. Maybe you could try the
>'update' svn command, i.e. if you want to revert the file
>foo.txt to revision 5, you can do :
>
>svn update -r 5 foo.txt

The wanted behavior of revert is that the specified version is rolled
back and committed to the repository as a new version. Will it work
that way with this command ? What is the difference / advantage over
using svn cat ?

> Note : Working with a copy (c1) then update another copy (c2)
> ..
>
> Updating works fine. It sometimes fails if the working copy is locked
> (why is it locked ? Maybe some wrong manipulation). Maybe a 'svn
> cleanup' before the update could be useful (didn't see where you deal
> with update in Subversion.pm).

Cleanup is not part of Subversion.pm - from the manual I understood
this is a maintenance routine you should not need too often. Hence I
put it in the Subversion plugin
(share/zim/plugins/VersionControl/Subversion.pl).

> Global note : message textarea
> 
>
> In the details textarea of the version window, which have to show the
> commit message, the text always begin with a 'e' (see a screenshot here:
> http://www.omacronides.com/tmp/zim_version_dialog.png )

Action item #5: Fix parsing of the revision message.

> About bazaar : slowing the index pane building
> 
>
> I'm playing with bazaar since a couple of weeks. The first contact

Re: [Zim-wiki] Subversion support

2008-10-11 Thread Rui Nibau
Hi all.

Sorry for the length of this message.

All tests above are made with the latest Zim snapshot (0.26) provide by
Jaap in the tmp folder, under Ubuntu 8.04, with subversion version 1.5.1
(r32289), bazaar 1.3.1.

About subversion


- All zim actions are matched / tested against svn command line
equivalents.
- I'm using local repos, i.e. 'file:///' urls. I've created a dedicated
svn repos to avoid any potential conflict with other projects already
versioned.

1. Project already versioned


Using a simple project already versioned, then defining it as a Zim
notebook.

Project tree :
page1
page1-1
page2

The versioning is recognized and you can work with it.

By the way, if users wants to use an already versioned project as a zim
notebook, they have to define themselves a svn:ignore property to
avoid .zim folder to be versioned (this is automatically done when you
start versioning with Zim).

Note : ignoring .zim folder


Maybe that could be done with Zim but certainly with great difficulties
because you have to deal with eventual already defined svn:ignore
properties (as a versioned property or as a repository revision
property). If it's defined as repository revision property in the latest
revision, you must have the right to modify it ; next you have to edit
it. And, most important, i can ONLY work if the project isn't a Zim
notebook yet (the .zim folder hasn't been versioned).

Too much work for a problem that isn't really annoying and that
shouldn't be really common. A user warning on the manual should be
enough.

2. Start versioning with Zim


I create a Zim notebook with a couple of pages, then try to version it.

2.1. Start versioning ... KO

Importing the notebook doesn't work i f the folder in the repos doesn't
exist.

In the init function, you check if svn info output contains "(Not a
valid URL)" (line 74). In my operating system (french), the svn info
command returns a string containing "(URL non valide)". Seems that test
string should be localized.

Note : url field
..

In the repository dialog window : maybe the 'http' it's not really
necessary for the url field, since you can also connect to a svn repos
with "file://" or 'svn://' protocols.


3. Working with a versionned notebook


3.1.add a page then commit .. OK

3.2.remove a page then commit ... OK

3.3.rename a page then commit ... OK

3.4.add a page in a namespace then commit ... OK

3.5.remove a page in a namespace then commit .. ~ OK

If the namespace is empty, the folder itself isn't deleted. So, 
if i delete 'page1-1' and commit, the folder 'page1' is still 
in the repos.

It could be annoying if users have the habit to delete a lot of 
namespaces.

3.6.rename a namespace .. OK

3.7.Restore a previous version of a page  KO

The restore function doesn't seem to work. Here's Zim output :

## dispatch Versions:  (Zim::GUI)
## AUTOLOAD Zim::GUI::VersionsDialog
# svn log "/home/[login]/zim_svn/project1/page1.txt"
# svn cat "-r" 5 "/home/[login]/zim_svn/project1/page1.txt"
*** unhandled exception in callback:
***   Can't locate object method "new" via package
"Zmi::FS::File" (perhaps you forgot to load "Zmi::FS::File"?)
at /usr/local/share/perl/5.8.8/Zim/FS/Subversion.pm line 130.
***  ignoring at /usr/local/bin/zim line 332.

In the 'revert' function (Subversion.pm) that you try to use
the 'revert' svn command or simply rewrite the file with the
output of the 'cat' svn command. Maybe you could try the
'update' svn command, i.e. if you want to revert the file
foo.txt to revision 5, you can do :

svn update -r 5 foo.txt

Note : Working with a copy (c1) then update another copy (c2)
..

Updating works fine. It sometimes fails if the working copy is locked
(why is it locked ? Maybe some wrong manipulation). Maybe a 'svn
cleanup' before the update could be useful (didn't see where you deal
with update in Subversion.pm).

Global note : message textarea


In the details textarea of the version window, which have to show the
commit message, the text always begin with a 'e' (see a screenshot here:
http:

[Zim-wiki] Subversion support

2008-10-10 Thread Jaap Karssenberg
Hi,

Yesterday I finished reworking the Subversion support. Not yet
submitted due to network trouble, but I uploaded a snapshot here:
http://pardus.nl/tmp

Since I use Bazaar myself I would like to hear back from the more
heavy Subversion users whether it works or whether I forgot something.
Please check out the snapshot above and let me know an OK / NOK to go
ahead releasing this. Please check usage both on exiting notebooks as
well as creating a new one and enabling SVN (just click "save version"
the first time).

In theory support should now work the same as for Bazaar, so the "Save
Version" and "Versions..." dialogs from the File menu work. Also kept
the "SVN Commit" (same as "save version"), "SVN Update" and "SVN
Cleanup" items in the Tools menu. Also I kept the check whether a page
is up to date on each page load as the old plugin was doing. When you
initialize version control on a new notebook you get to choose between
Bazaar and Subversion, choosing svn will prompt for url / username /
password. I decided to create the URL with mkdir if it does not yet
exist and then go for checkout; files will be added in the subsequent
commit. This way we can circumvent all the nastiness of having to use
import.

In the mean time I will try to pack as many small fixes from the bug
tracker as I can do in about one day and then go prepare a new
release. Allowing time for testing and updating translations that
would put a new release on the agenda in about ~4 weeks time. After
that I'll go off for a while hacking on my python implementation.

Regards,

Jaap <[EMAIL PROTECTED]>

P.S. anyone here planning to attend the CCC congress in Berlin end of December ?

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp