[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Possible fix for issue 121 : unable to "share project" using SVN

From: Brock Janiczak <brockj_eclipse_at_ihug.com.au>
Date: 2004-08-17 13:42:03 CEST

Hi All,

I have looked into why the share project wizard is failing. It seems to
be due with inconsistent handling of unversioned files. I have attached
a patch that i *THINK* fixes the problem. I have only tested the
command line adapter as i can't get the JHL client to work at all at the
moment (linkage errors).

I am reluctant to check these changes in as i caused the problem and am
not very familiar with the client adapter at all. Could someone please
review these changes?

Here are the changes i have made:

CmdLineClientAdapter
Made error parsing less strict to pick up the different message returned
by a recursive status. Also made it return an Unversioned status
instead of an empty list to make it like the JHL adapter.

JhlClientAdapter
Made it like the single status case where we catch errors and look for
the specific error number. It is assumed that if the error is
SVN_ERR_WC_NOT_DIRECTORY that it was caused by the input file (i can't
see anything too wrong with this assumption)

Thanks,
    Brock

Index:
d:/data/eclipse/workspace/svnClientAdapter/src/main/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java
===================================================================
---
d:/data/eclipse/workspace/svnClientAdapter/src/main/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java
(revision 836)
+++
d:/data/eclipse/workspace/svnClientAdapter/src/main/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java
(working copy)
@@ -626,8 +626,8 @@
             return cmdLineStatuses.toArray();
 
         } catch (CmdLineException e) {
- if (e.getMessage().startsWith("svn: Path is not a working
copy directory")) {
- return new ISVNStatus[0];
+ if (e.getMessage().trim().matches("svn:.*is not a working
copy.*")) {
+ return new ISVNStatus[] {new SVNStatusUnversioned(path)};
             }
             throw SVNClientException.wrapException(e);
         }
Index:
d:/data/eclipse/workspace/svnClientAdapter/src/main/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapter.java
===================================================================
---
d:/data/eclipse/workspace/svnClientAdapter/src/main/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapter.java
(revision 836)
+++
d:/data/eclipse/workspace/svnClientAdapter/src/main/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapter.java
(working copy)
@@ -512,8 +512,13 @@
                     getAll)); // retrieve all entries; otherwise,
retrieve only "interesting" entries (local mods and/or
                                  // out-of-date).
         } catch (ClientException e) {
- notificationHandler.logException(e);
- throw new SVNClientException(e);
+ if (e.getAprError() == SVN_ERR_WC_NOT_DIRECTORY) {
+ // when there is no .svn dir, an exception is thrown ...
+ return new ISVNStatus[] {new SVNStatusUnversioned(path)};
+ } else {
+ notificationHandler.logException(e);
+ throw new SVNClientException(e);
+ }
         }
     }
 
Received on Tue Aug 17 21:42:03 2004

This is an archived mail posted to the Subclipse Dev mailing list.