Quick Fix for subversion 1.7 #101

Merged
merged 1 commit into from May 20, 2013

Conversation

Projects
None yet
3 participants

frlan added a commit that referenced this pull request May 20, 2013

Merge pull request #101 from brunob/patch-1
Quick Fix for subversion 1.7

@frlan frlan merged commit 23fdaf9 into geany:master May 20, 2013

@brunob brunob deleted the brunob:patch-1 branch May 23, 2013

@eht16

This comment has been minimized.

Show comment Hide comment
@eht16

eht16 Jun 1, 2013

Member

This is nice but unfortunately not yet enough to support SVN 1.7, e.g. diff is still broken.

In http://sourceforge.net/p/geany-plugins/bugs/84/ there is another change which also re-enables diff for files, IIRC.
Frank, could that other change be merged as well?

That would be cool for us poor users who are still stuck with SVN.

Member

eht16 commented Jun 1, 2013

This is nice but unfortunately not yet enough to support SVN 1.7, e.g. diff is still broken.

In http://sourceforge.net/p/geany-plugins/bugs/84/ there is another change which also re-enables diff for files, IIRC.
Frank, could that other change be merged as well?

That would be cool for us poor users who are still stuck with SVN.

@eht16

This comment has been minimized.

Show comment Hide comment
@eht16

eht16 Jun 1, 2013

Member

Regarding the mentioned change in the SF bug report:
a slightly better variant:

diff --git a/geanyvc/src/vc_svn.c b/geanyvc/src/vc_svn.c
index da44197..66ab451 100644
--- a/geanyvc/src/vc_svn.c
+++ b/geanyvc/src/vc_svn.c
@@ -159,6 +159,12 @@ get_base_dir(const gchar * path)
    }
    while (strcmp(base, base_prev) != 0);

+   if (base_prev == NULL)
+   {
+       /* fallback for Subversion 1.7: try to climb up the tree until we
+        * find a .svn subdirectory */
+        base_prev = find_subdir_path(path, ".svn");
+   }
    g_free(base);
    return base_prev;
 }

This should fix commit/diff and related commands for Sbversion 1.7 and retain backwards compatibility for older versions.

Member

eht16 commented Jun 1, 2013

Regarding the mentioned change in the SF bug report:
a slightly better variant:

diff --git a/geanyvc/src/vc_svn.c b/geanyvc/src/vc_svn.c
index da44197..66ab451 100644
--- a/geanyvc/src/vc_svn.c
+++ b/geanyvc/src/vc_svn.c
@@ -159,6 +159,12 @@ get_base_dir(const gchar * path)
    }
    while (strcmp(base, base_prev) != 0);

+   if (base_prev == NULL)
+   {
+       /* fallback for Subversion 1.7: try to climb up the tree until we
+        * find a .svn subdirectory */
+        base_prev = find_subdir_path(path, ".svn");
+   }
    g_free(base);
    return base_prev;
 }

This should fix commit/diff and related commands for Sbversion 1.7 and retain backwards compatibility for older versions.

@brunob

This comment has been minimized.

Show comment Hide comment
@brunob

brunob Sep 22, 2013

Contributor

Thanks for this fix @eht16 :) I'm using git version of geany and geany-plugins for now and can't get any diff view, the status show that a file is modified but when i hit diff for the file from geanyvc menu i just get a message telling that nothing is modified? Do you get the same behavior form your side ?

Contributor

brunob commented Sep 22, 2013

Thanks for this fix @eht16 :) I'm using git version of geany and geany-plugins for now and can't get any diff view, the status show that a file is modified but when i hit diff for the file from geanyvc menu i just get a message telling that nothing is modified? Do you get the same behavior form your side ?

@eht16

This comment has been minimized.

Show comment Hide comment
@eht16

eht16 Sep 25, 2013

Member

Hey. Not really an idea what could be wrong. For me, current Git master now works properly with Subversion 1.7, I (have to) use it at daily work.

Do you use Subversion 1.8 by chance? I don't know the details but the repository format has changed again, probably not relevant for GeanyVC but who knows.

Where is the file you tested located in the directory tree relative to the root folder containing .svn?
Do you see any relevant output in Help->Debug Messages?

Could you try to debug(either with printf statements or gdb) vc_svn.c:in_vc_svn() to check whether it finds anything and if, what?

Member

eht16 commented Sep 25, 2013

Hey. Not really an idea what could be wrong. For me, current Git master now works properly with Subversion 1.7, I (have to) use it at daily work.

Do you use Subversion 1.8 by chance? I don't know the details but the repository format has changed again, probably not relevant for GeanyVC but who knows.

Where is the file you tested located in the directory tree relative to the root folder containing .svn?
Do you see any relevant output in Help->Debug Messages?

Could you try to debug(either with printf statements or gdb) vc_svn.c:in_vc_svn() to check whether it finds anything and if, what?

@brunob

This comment has been minimized.

Show comment Hide comment
@brunob

brunob Sep 26, 2013

Contributor

Ok i've found the origin of the bug. Here is my case the diff return that nothing is modified if i open the file from a folder that is a symlink to the original file. If i open the same (modified) file from his original location, the diff function works.

Not sure about that, but it may come from the recent change in symlink handling in ubuntu (or nautilus).

Contributor

brunob commented Sep 26, 2013

Ok i've found the origin of the bug. Here is my case the diff return that nothing is modified if i open the file from a folder that is a symlink to the original file. If i open the same (modified) file from his original location, the diff function works.

Not sure about that, but it may come from the recent change in symlink handling in ubuntu (or nautilus).

@frlan

This comment has been minimized.

Show comment Hide comment
@frlan

frlan Sep 26, 2013

Member

Well.... I think it might could be caused also by the way we are handling files inside the plugin ...

Member

frlan commented Sep 26, 2013

Well.... I think it might could be caused also by the way we are handling files inside the plugin ...

@eht16

This comment has been minimized.

Show comment Hide comment
@eht16

eht16 Sep 28, 2013

Member

Ah, pretty obvious then:
GeanyVC uses the file path(really the path of the file, not the link target in case it is a symlink) and walk the directory tree up until it find a .svn directory but if there is no .svn because the Subversion working copy is somewhere else, GeanyVC can't find it.

I just checked and the same happens with Git. So this is rather a somewhat unrelated and more general bug. @brunob: would you mind opening a new bug report for this issue?

Member

eht16 commented Sep 28, 2013

Ah, pretty obvious then:
GeanyVC uses the file path(really the path of the file, not the link target in case it is a symlink) and walk the directory tree up until it find a .svn directory but if there is no .svn because the Subversion working copy is somewhere else, GeanyVC can't find it.

I just checked and the same happens with Git. So this is rather a somewhat unrelated and more general bug. @brunob: would you mind opening a new bug report for this issue?

@brunob

This comment has been minimized.

Show comment Hide comment
@brunob

brunob Oct 2, 2013

Contributor

I'm not sure it's an issue related to geany vc cause this type of setup worked like a charm in previous ubuntu release. Since 13.04 the symlink handling has changed in nautilus : now if you open a symlink "folder" the path is the original path and not the path to the symlink. Maybe the bug comes form that ?

Anyway, i'll open a new bug if necessary.

Contributor

brunob commented Oct 2, 2013

I'm not sure it's an issue related to geany vc cause this type of setup worked like a charm in previous ubuntu release. Since 13.04 the symlink handling has changed in nautilus : now if you open a symlink "folder" the path is the original path and not the path to the symlink. Maybe the bug comes form that ?

Anyway, i'll open a new bug if necessary.

@eht16

This comment has been minimized.

Show comment Hide comment
@eht16

eht16 Oct 6, 2013

Member

No idea but I doubt. GeanyVC uses normal C/POSIX functions to access the files and symlinks, I can't imagine Ubuntu changed their behaviour. The changed behaviour in Nautilus is probably only in the graphical interface and so rather unrelated. Though, this is just guessing, I don't use Ubuntu.

Member

eht16 commented Oct 6, 2013

No idea but I doubt. GeanyVC uses normal C/POSIX functions to access the files and symlinks, I can't imagine Ubuntu changed their behaviour. The changed behaviour in Nautilus is probably only in the graphical interface and so rather unrelated. Though, this is just guessing, I don't use Ubuntu.

@brunob

This comment has been minimized.

Show comment Hide comment
@brunob

brunob Oct 7, 2013

Contributor

@eht16 i've tried to open a new bug report but issues are not available on this repo and i can't open a pull request cause i don't have any fix for this bug.

Contributor

brunob commented Oct 7, 2013

@eht16 i've tried to open a new bug report but issues are not available on this repo and i can't open a pull request cause i don't have any fix for this bug.

@eht16

This comment has been minimized.

Show comment Hide comment
@eht16

eht16 Oct 10, 2013

Member
Member

eht16 commented Oct 10, 2013

@brunob

This comment has been minimized.

Show comment Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment