You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/03/30 22:58:01 UTC
svn commit: r929279 [6/20] - in /subversion/branches/svn-patch-improvements:
./ build/ac-macros/ build/generator/ build/generator/templates/
contrib/client-side/emacs/ notes/feedback/ notes/meetings/ notes/wc-ng/
subversion/ subversion/bindings/javahl/...
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/ProplistCallback.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/ProplistCallback.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/ProplistCallback.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/ProplistCallback.java Tue Mar 30 20:57:53 2010
@@ -23,10 +23,6 @@
package org.tigris.subversion.javahl;
-import org.apache.subversion.javahl.callback.*;
-
-import java.util.Map;
-
/**
* This interface is used to property lists for each path in a
* SVNClientInterface.properties call.
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Revision.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Revision.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Revision.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Revision.java Tue Mar 30 20:57:53 2010
@@ -23,8 +23,6 @@
package org.tigris.subversion.javahl;
-import org.apache.subversion.javahl.*;
-
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
@@ -159,22 +157,22 @@ public class Revision implements java.io
public org.apache.subversion.javahl.Revision toApache()
{
- return new org.apache.subversion.javahl.Revision(revKind);
+ return new org.apache.subversion.javahl.Revision(Kind.toAKind(revKind));
}
public static Revision createFromApache(
org.apache.subversion.javahl.Revision aRev)
{
- int kind = aRev.getKind();
+ org.apache.subversion.javahl.Revision.Kind kind = aRev.getKind();
switch (kind)
{
- case org.apache.subversion.javahl.Revision.Kind.number:
+ case number:
return getInstance(((org.apache.subversion.javahl.Revision.Number) aRev).getNumber());
- case org.apache.subversion.javahl.Revision.Kind.date:
+ case date:
return getInstance(((org.apache.subversion.javahl.Revision.DateSpec) aRev).getDate());
default:
- return getInstance(kind);
+ return getInstance(Kind.fromAKind(kind));
}
}
@@ -370,5 +368,52 @@ public class Revision implements java.io
*/
public static final class Kind implements RevisionKind
{
+ public static int fromAKind(org.apache.subversion.javahl.Revision.Kind aKind)
+ {
+ switch (aKind)
+ {
+ default:
+ case unspecified:
+ return RevisionKind.unspecified;
+ case number:
+ return RevisionKind.number;
+ case date:
+ return RevisionKind.date;
+ case committed:
+ return RevisionKind.committed;
+ case previous:
+ return RevisionKind.previous;
+ case base:
+ return RevisionKind.base;
+ case head:
+ return RevisionKind.head;
+ case working:
+ return RevisionKind.working;
+ }
+ }
+
+ public static org.apache.subversion.javahl.Revision.Kind toAKind(int kind)
+ {
+ switch (kind)
+ {
+ default:
+ case RevisionKind.unspecified:
+ return org.apache.subversion.javahl.Revision.Kind.unspecified;
+ case RevisionKind.number:
+ return org.apache.subversion.javahl.Revision.Kind.number;
+ case RevisionKind.date:
+ return org.apache.subversion.javahl.Revision.Kind.date;
+ case RevisionKind.committed:
+ return org.apache.subversion.javahl.Revision.Kind.committed;
+ case RevisionKind.previous:
+ return org.apache.subversion.javahl.Revision.Kind.previous;
+ case RevisionKind.base:
+ return org.apache.subversion.javahl.Revision.Kind.base;
+ case RevisionKind.head:
+ return org.apache.subversion.javahl.Revision.Kind.head;
+ case RevisionKind.working:
+ return org.apache.subversion.javahl.Revision.Kind.working;
+ }
+ }
}
}
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java Tue Mar 30 20:57:53 2010
@@ -80,7 +80,7 @@ public class SVNAdmin
public Version getVersion()
{
return new Version(
- org.apache.subversion.javahl.NativeResources.version);
+ org.apache.subversion.javahl.NativeResources.getVersion());
}
/**
@@ -426,7 +426,7 @@ public class SVNAdmin
Revision start, Revision end)
throws ClientException
{
- try
+ try
{
aSVNAdmin.verify(path, messageOut,
start == null ? null : start.toApache(),
@@ -452,7 +452,7 @@ public class SVNAdmin
Set<org.apache.subversion.javahl.Lock> aLocks =
aSVNAdmin.lslocks(path);
Lock[] locks = new Lock[aLocks.size()];
-
+
int i = 0;
for (org.apache.subversion.javahl.Lock lock : aLocks)
{
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java Tue Mar 30 20:57:53 2010
@@ -23,8 +23,6 @@
package org.tigris.subversion.javahl;
-import org.apache.subversion.javahl.*;
-
import java.io.OutputStream;
import java.util.Map;
@@ -85,7 +83,7 @@ public class SVNClient implements SVNCli
public Version getVersion()
{
return new Version(
- org.apache.subversion.javahl.NativeResources.version);
+ org.apache.subversion.javahl.NativeResources.getVersion());
}
/**
@@ -189,8 +187,8 @@ public class SVNClient implements SVNCli
{
try
{
- aSVNClient.status(path, depth, onServer, getAll, noIgnore,
- ignoreExternals,
+ aSVNClient.status(path, Depth.toADepth(depth), onServer, getAll,
+ noIgnore, ignoreExternals,
changelists == null ? null
: Arrays.asList(changelists),
new org.apache.subversion.javahl.callback.StatusCallback () {
@@ -283,7 +281,7 @@ public class SVNClient implements SVNCli
aSVNClient.list(url,
revision == null ? null : revision.toApache(),
pegRevision == null ? null : pegRevision.toApache(),
- depth, direntFields, fetchLocks,
+ Depth.toADepth(depth), direntFields, fetchLocks,
new org.apache.subversion.javahl.callback.ListCallback () {
public void doEntry(org.apache.subversion.javahl.DirEntry dirent,
org.apache.subversion.javahl.Lock lock)
@@ -477,7 +475,7 @@ public class SVNClient implements SVNCli
Map<String, String> oldRevprops =
new HashMap<String, String>();
ChangePath[] changedPaths;
-
+
if (aChangedPaths != null)
{
changedPaths = new ChangePath[aChangedPaths.size()];
@@ -508,7 +506,7 @@ public class SVNClient implements SVNCli
try
{
- List<org.apache.subversion.javahl.RevisionRange> aRevisions =
+ List<org.apache.subversion.javahl.RevisionRange> aRevisions =
new ArrayList<org.apache.subversion.javahl.RevisionRange>(revisionRanges.length);
for (RevisionRange range : revisionRanges)
@@ -572,7 +570,8 @@ public class SVNClient implements SVNCli
return aSVNClient.checkout(moduleName, destPath,
revision == null ? null : revision.toApache(),
pegRevision == null ? null : pegRevision.toApache(),
- depth, ignoreExternals, allowUnverObstructions);
+ Depth.toADepth(depth), ignoreExternals,
+ allowUnverObstructions);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -584,9 +583,18 @@ public class SVNClient implements SVNCli
* @deprecated Use {@link #notification2(Notify2)} instead.
* @since 1.0
*/
- public void notification(Notify notify)
+ public void notification(final Notify notify)
{
- aSVNClient.notification(notify);
+ notification2(
+ new Notify2 () {
+ public void onNotify(NotifyInformation info)
+ {
+ notify.onNotify(info.getPath(), info.getAction(),
+ info.getKind(), info.getMimeType(),
+ info.getContentState(), info.getPropState(),
+ info.getRevision());
+ }
+ });
}
/**
@@ -725,8 +733,8 @@ public class SVNClient implements SVNCli
{
try
{
- aSVNClient.revert(path, depth, changelists == null ? null
- : Arrays.asList(changelists));
+ aSVNClient.revert(path, Depth.toADepth(depth),
+ changelists == null ? null : Arrays.asList(changelists));
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -765,7 +773,8 @@ public class SVNClient implements SVNCli
{
try
{
- aSVNClient.add(path, depth, force, noIgnores, addParents);
+ aSVNClient.add(path, Depth.toADepth(depth), force, noIgnores,
+ addParents);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -821,8 +830,8 @@ public class SVNClient implements SVNCli
{
return aSVNClient.update(new HashSet<String>(Arrays.asList(paths)),
revision == null ? null : revision.toApache(),
- depth, depthIsSticky, ignoreExternals,
- allowUnverObstructions);
+ Depth.toADepth(depth), depthIsSticky,
+ ignoreExternals, allowUnverObstructions);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -865,7 +874,7 @@ public class SVNClient implements SVNCli
try
{
return aSVNClient.commit(new HashSet<String>(Arrays.asList(paths)),
- message, depth, noUnlock,
+ message, Depth.toADepth(depth), noUnlock,
keepChangelist,
changelists == null ? null
: Arrays.asList(changelists),
@@ -1049,7 +1058,9 @@ public class SVNClient implements SVNCli
{
try
{
- aSVNClient.resolve(path, depth, conflictResult);
+ aSVNClient.resolve(path, Depth.toADepth(depth),
+ org.apache.subversion.javahl.ConflictResult.Choice.values()[
+ conflictResult]);
}
catch (org.apache.subversion.javahl.SubversionException ex)
{
@@ -1099,7 +1110,8 @@ public class SVNClient implements SVNCli
return aSVNClient.doExport(srcPath, destPath,
revision == null ? null : revision.toApache(),
pegRevision == null ? null : pegRevision.toApache(),
- force, ignoreExternals, depth, nativeEOL);
+ force, ignoreExternals, Depth.toADepth(depth),
+ nativeEOL);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -1134,7 +1146,7 @@ public class SVNClient implements SVNCli
return aSVNClient.doSwitch(path, url,
revision == null ? null : revision.toApache(),
pegRevision == null ? null : pegRevision.toApache(),
- depth, depthIsSticky, ignoreExternals,
+ Depth.toADepth(depth), depthIsSticky, ignoreExternals,
allowUnverObstructions);
}
catch (org.apache.subversion.javahl.ClientException ex)
@@ -1166,8 +1178,8 @@ public class SVNClient implements SVNCli
{
try
{
- aSVNClient.doImport(path, url, message, depth, noIgnore,
- ignoreUnknownNodeTypes, revpropTable);
+ aSVNClient.doImport(path, url, message, Depth.toADepth(depth),
+ noIgnore, ignoreUnknownNodeTypes, revpropTable);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -1238,8 +1250,8 @@ public class SVNClient implements SVNCli
revision1 == null ? null : revision1.toApache(),
path2,
revision2 == null ? null : revision2.toApache(),
- localPath, force, depth, ignoreAncestry,
- dryRun, recordOnly);
+ localPath, force, Depth.toADepth(depth),
+ ignoreAncestry, dryRun, recordOnly);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -1274,7 +1286,7 @@ public class SVNClient implements SVNCli
{
try
{
- List<org.apache.subversion.javahl.RevisionRange> aRevisions =
+ List<org.apache.subversion.javahl.RevisionRange> aRevisions =
new ArrayList<org.apache.subversion.javahl.RevisionRange>(revisions.length);
for (RevisionRange range : revisions )
@@ -1284,7 +1296,7 @@ public class SVNClient implements SVNCli
aSVNClient.merge(path,
pegRevision == null ? null : pegRevision.toApache(),
- aRevisions, localPath, force, depth,
+ aRevisions, localPath, force, Depth.toADepth(depth),
ignoreAncestry, dryRun, recordOnly);
}
catch (org.apache.subversion.javahl.ClientException ex)
@@ -1320,7 +1332,7 @@ public class SVNClient implements SVNCli
{
try
{
- org.apache.subversion.javahl.Mergeinfo aMergeinfo =
+ org.apache.subversion.javahl.Mergeinfo aMergeinfo =
aSVNClient.getMergeinfo(path,
pegRevision == null ? null : pegRevision.toApache());
@@ -1380,15 +1392,15 @@ public class SVNClient implements SVNCli
try
{
- aSVNClient.getMergeinfoLog(kind, pathOrUrl,
- pegRevision == null ? null : pegRevision.toApache(),
- mergeSourceUrl,
- srcPegRevision == null ? null :
- srcPegRevision.toApache(),
- discoverChangedPaths, depth,
- revprops == null ? null
- : new HashSet<String>(Arrays.asList(revprops)),
- new aLogMessageCallback());
+ aSVNClient.getMergeinfoLog(
+ org.apache.subversion.javahl.MergeinfoLogKind.values()[kind],
+ pathOrUrl, pegRevision == null ? null : pegRevision.toApache(),
+ mergeSourceUrl,
+ srcPegRevision == null ? null : srcPegRevision.toApache(),
+ discoverChangedPaths, Depth.toADepth(depth),
+ revprops == null ? null
+ : new HashSet<String>(Arrays.asList(revprops)),
+ new aLogMessageCallback());
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -1481,7 +1493,7 @@ public class SVNClient implements SVNCli
revision1 == null ? null : revision1.toApache(),
target2,
revision2 == null ? null : revision2.toApache(),
- relativeToDir, outFileName, depth,
+ relativeToDir, outFileName, Depth.toADepth(depth),
changelists == null ? null
: Arrays.asList(changelists),
ignoreAncestry, noDiffDeleted, force,
@@ -1546,7 +1558,7 @@ public class SVNClient implements SVNCli
pegRevision == null ? null : pegRevision.toApache(),
startRevision == null ? null : startRevision.toApache(),
endRevision == null ? null : endRevision.toApache(),
- relativeToDir, outFileName, depth,
+ relativeToDir, outFileName, Depth.toADepth(depth),
changelists == null ? null : Arrays.asList(changelists),
ignoreAncestry, noDiffDeleted, force, copiesAsAdds);
}
@@ -1574,7 +1586,7 @@ public class SVNClient implements SVNCli
revision1 == null ? null : revision1.toApache(),
target2,
revision2 == null ? null : revision2.toApache(),
- depth,
+ Depth.toADepth(depth),
changelists == null ? null
: Arrays.asList(changelists),
ignoreAncestry, aReceiver);
@@ -1603,7 +1615,7 @@ public class SVNClient implements SVNCli
pegRevision == null ? null : pegRevision.toApache(),
startRevision == null ? null : startRevision.toApache(),
endRevision == null ? null : endRevision.toApache(),
- depth, changelists == null ? null
+ Depth.toADepth(depth), changelists == null ? null
: Arrays.asList(changelists),
ignoreAncestry, aReceiver);
}
@@ -1677,7 +1689,7 @@ public class SVNClient implements SVNCli
aSVNClient.properties(path,
revision == null ? null : revision.toApache(),
pegRevision == null ? null : pegRevision.toApache(),
- depth, changelists == null ? null
+ Depth.toADepth(depth), changelists == null ? null
: Arrays.asList(changelists), callback);
}
catch (org.apache.subversion.javahl.ClientException ex)
@@ -1745,7 +1757,7 @@ public class SVNClient implements SVNCli
{
try
{
- aSVNClient.propertySet(path, name, value, depth,
+ aSVNClient.propertySet(path, name, value, Depth.toADepth(depth),
changelists == null ? null
: Arrays.asList(changelists),
force, revpropTable);
@@ -2254,7 +2266,8 @@ public class SVNClient implements SVNCli
try
{
aSVNClient.addToChangelist(
- new HashSet<String>(Arrays.asList(paths)), changelist, depth,
+ new HashSet<String>(Arrays.asList(paths)), changelist,
+ Depth.toADepth(depth),
changelists == null ? null : Arrays.asList(changelists));
}
catch (org.apache.subversion.javahl.ClientException ex)
@@ -2273,7 +2286,8 @@ public class SVNClient implements SVNCli
try
{
aSVNClient.removeFromChangelists(
- new HashSet<String>(Arrays.asList(paths)), depth,
+ new HashSet<String>(Arrays.asList(paths)),
+ Depth.toADepth(depth),
changelists == null ? null
: Arrays.asList(changelists));
}
@@ -2294,7 +2308,7 @@ public class SVNClient implements SVNCli
{
aSVNClient.getChangelists(rootPath, changelists == null ? null
: Arrays.asList(changelists),
- depth, callback);
+ Depth.toADepth(depth), callback);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
@@ -2343,8 +2357,10 @@ public class SVNClient implements SVNCli
*/
public static void enableLogging(int logLevel, String logFilePath)
{
- org.apache.subversion.javahl.SVNClient.enableLogging(logLevel,
- logFilePath);
+ org.apache.subversion.javahl.SVNClient.enableLogging(
+ org.apache.subversion.javahl.SVNClient.ClientLogLevel.values()[
+ logLevel],
+ logFilePath);
}
/**
@@ -2462,7 +2478,7 @@ public class SVNClient implements SVNCli
aSVNClient.info2(pathOrUrl,
revision == null ? null : revision.toApache(),
pegRevision == null ? null : pegRevision.toApache(),
- depth, changelists == null ? null
+ Depth.toADepth(depth), changelists == null ? null
: Arrays.asList(changelists),
new org.apache.subversion.javahl.callback.InfoCallback () {
public void singleInfo(org.apache.subversion.javahl.Info2 aInfo)
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java Tue Mar 30 20:57:53 2010
@@ -331,7 +331,7 @@ public interface SVNClientInterface
* Retrieve the log messages for an item.
* @param path path or url to get the log message for.
* @param pegRevision revision to interpret path
- * @param revisionRanges an array of revision ranges to show
+ * @param ranges an array of revision ranges to show
* @param stopOnCopy do not continue on copy operations
* @param discoverPath returns the paths of the changed items in the
* returned objects
@@ -1108,7 +1108,7 @@ public interface SVNClientInterface
void getMergeinfoLog(int kind, String pathOrUrl,
Revision pegRevision, String mergeSourceUrl,
Revision srcPegRevision, boolean discoverChangedPaths,
- int depth, String[] revprops,
+ int depth, String[] revProps,
LogMessageCallback callback)
throws ClientException;
@@ -1131,7 +1131,7 @@ public interface SVNClientInterface
void getMergeinfoLog(int kind, String pathOrUrl,
Revision pegRevision, String mergeSourceUrl,
Revision srcPegRevision, boolean discoverChangedPaths,
- String[] revprops, LogMessageCallback callback)
+ String[] revProps, LogMessageCallback callback)
throws ClientException;
/**
@@ -1888,7 +1888,7 @@ public interface SVNClientInterface
* @param changelists changelists to filter by
* @since 1.5
*/
- void removeFromChangelists(String[] paths, int depth, String[] changelist)
+ void removeFromChangelists(String[] paths, int depth, String[] changelists)
throws ClientException;
/**
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Status.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Status.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Status.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Status.java Tue Mar 30 20:57:53 2010
@@ -322,13 +322,15 @@ public class Status implements java.io.S
*/
public Status(org.apache.subversion.javahl.Status aStatus)
{
- this(aStatus.getPath(), aStatus.getUrl(), aStatus.getNodeKind(),
+ this(aStatus.getPath(), aStatus.getUrl(),
+ NodeKind.fromApache(aStatus.getNodeKind()),
aStatus.getRevisionNumber(),
aStatus.getLastChangedRevisionNumber(),
aStatus.getLastChangedDateMicros(), aStatus.getLastCommitAuthor(),
- aStatus.getTextStatus(), aStatus.getPropStatus(),
- aStatus.getRepositoryTextStatus(),
- aStatus.getRepositoryPropStatus(),
+ fromAStatusKind(aStatus.getTextStatus()),
+ fromAStatusKind(aStatus.getPropStatus()),
+ fromAStatusKind(aStatus.getRepositoryTextStatus()),
+ fromAStatusKind(aStatus.getRepositoryPropStatus()),
aStatus.isLocked(), aStatus.isCopied(), aStatus.hasTreeConflict(),
aStatus.getConflictDescriptor() == null ? null
: new ConflictDescriptor(aStatus.getConflictDescriptor()),
@@ -341,7 +343,8 @@ public class Status implements java.io.S
aStatus.getReposLock() == null ? null
: new Lock(aStatus.getReposLock()),
aStatus.getReposLastCmtRevisionNumber(),
- aStatus.getReposLastCmtDateMicros(), aStatus.getReposKind(),
+ aStatus.getReposLastCmtDateMicros(),
+ NodeKind.fromApache(aStatus.getReposKind()),
aStatus.getReposLastCmtAuthor(), aStatus.getChangelist());
}
@@ -866,4 +869,44 @@ public class Status implements java.io.S
{
return (micros == 0 ? null : new Date(micros / 1000));
}
+
+ private static int fromAStatusKind(
+ org.apache.subversion.javahl.Status.Kind aKind)
+ {
+ if (aKind == null)
+ return StatusKind.none;
+
+ switch (aKind)
+ {
+ default:
+ case none:
+ return StatusKind.none;
+ case normal:
+ return StatusKind.normal;
+ case modified:
+ return StatusKind.modified;
+ case added:
+ return StatusKind.added;
+ case deleted:
+ return StatusKind.deleted;
+ case unversioned:
+ return StatusKind.unversioned;
+ case missing:
+ return StatusKind.missing;
+ case replaced:
+ return StatusKind.replaced;
+ case merged:
+ return StatusKind.merged;
+ case conflicted:
+ return StatusKind.conflicted;
+ case obstructed:
+ return StatusKind.obstructed;
+ case ignored:
+ return StatusKind.ignored;
+ case incomplete:
+ return StatusKind.incomplete;
+ case external:
+ return StatusKind.external;
+ }
+ }
}
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SubversionException.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SubversionException.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SubversionException.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SubversionException.java Tue Mar 30 20:57:53 2010
@@ -23,8 +23,6 @@
package org.tigris.subversion.javahl;
-import org.apache.subversion.javahl.*;
-
/**
* This checked exception is thrown whenever something goes wrong with
* the Subversion JavaHL bindings.
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Version.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Version.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Version.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Version.java Tue Mar 30 20:57:53 2010
@@ -23,8 +23,6 @@
package org.tigris.subversion.javahl;
-import org.apache.subversion.javahl.*;
-
/**
* Encapsulates version information about the underlying native
* libraries. Basically a wrapper for <a
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Tue Mar 30 20:57:53 2010
@@ -42,7 +42,7 @@ import java.util.List;
import java.util.Set;
import java.util.Map;
import java.text.DateFormat;
-import java.text.SimpleDateFormat;
+import java.text.SimpleDateFormat;
/**
@@ -759,10 +759,15 @@ public class BasicTests extends SVNTests
false);
client.propertyCreate(itemPath, "cqcq", "qrz", Depth.empty, null,
false);
- MyProplistCallback callback = new MyProplistCallback();
- client.properties(itemPath, null, null, Depth.empty, null, callback);
- Map<String, byte[]> propMap = callback.getProperties(itemPath);
+ final Map<String, Map<String, byte[]>> propMaps =
+ new HashMap<String, Map<String, byte[]>>();
+ client.properties(itemPath, null, null, Depth.empty, null,
+ new ProplistCallback () {
+ public void singlePath(String path, Map<String, byte[]> props)
+ { propMaps.put(path, props); }
+ });
+ Map<String, byte[]> propMap = propMaps.get(itemPath);
for (String key : propMap.keySet())
{
assertEquals("cqcq", key);
@@ -1285,7 +1290,7 @@ public class BasicTests extends SVNTests
// flag A/mu as resolved
client.resolve(backupTest.getWCPath()+"/A/mu", Depth.empty,
- ConflictResult.chooseMerged);
+ ConflictResult.Choice.chooseMerged);
backupTest.getWc().setItemTextStatus("A/mu", Status.Kind.modified);
backupTest.getWc().removeItem("A/mu.r1");
backupTest.getWc().removeItem("A/mu.r2");
@@ -1293,7 +1298,7 @@ public class BasicTests extends SVNTests
// flag A/D/G/rho as resolved
client.resolve(backupTest.getWCPath()+"/A/D/G/rho", Depth.empty,
- ConflictResult.chooseMerged);
+ ConflictResult.Choice.chooseMerged);
backupTest.getWc().setItemTextStatus("A/D/G/rho",
Status.Kind.modified);
backupTest.getWc().removeItem("A/D/G/rho.r1");
@@ -2094,8 +2099,8 @@ public class BasicTests extends SVNTests
Depth.empty, null)[0];
assertEquals("wrong revision from info", 1,
info.getLastChangedRev());
- assertEquals("wrong schedule kind from info", ScheduleKind.normal,
- info.getSchedule());
+ assertEquals("wrong schedule kind from info",
+ Info2.ScheduleKind.normal, info.getSchedule());
assertEquals("wrong node kind from info", NodeKind.file,
info.getKind());
}
@@ -2352,38 +2357,32 @@ public class BasicTests extends SVNTests
* are no revisions to return.
* @since 1.5
*/
- private long[] getMergeinfoRevisions(int kind, String pathOrUrl,
+ private long[] getMergeinfoRevisions(MergeinfoLogKind kind,
+ String pathOrUrl,
Revision pegRevision,
String mergeSourceUrl,
- Revision srcPegRevision)
+ Revision srcPegRevision)
throws SubversionException
{
- class Callback implements LogMessageCallback {
-
- List<Long> revList = new ArrayList<Long>();
+ final List<Long> revList = new ArrayList<Long>();
- public void singleMessage(Set<ChangePath> changedPaths,
+ client.getMergeinfoLog(kind, pathOrUrl, pegRevision, mergeSourceUrl,
+ srcPegRevision, false, Depth.empty, null,
+ new LogMessageCallback () {
+ public void singleMessage(Set<ChangePath> changedPaths,
long revision, Map<String, byte[]> revprops,
- boolean hasChildren) {
- revList.add(new Long(revision));
- }
+ boolean hasChildren)
+ { revList.add(new Long(revision)); }
+ });
- public long[] getRevisions() {
- long[] revisions = new long[revList.size()];
- int i = 0;
- for (Long revision : revList)
- {
- revisions[i] = revision.longValue();
- i++;
- }
- return revisions;
- }
+ long[] revisions = new long[revList.size()];
+ int i = 0;
+ for (Long revision : revList)
+ {
+ revisions[i] = revision.longValue();
+ i++;
}
- Callback callback = new Callback();
- client.getMergeinfoLog(kind, pathOrUrl, pegRevision, mergeSourceUrl,
- srcPegRevision, false, Depth.empty, null,
- callback);
- return callback.getRevisions();
+ return revisions;
}
/**
@@ -2452,7 +2451,7 @@ public class BasicTests extends SVNTests
{
public void onNotify(NotifyInformation info)
{
- if (info.getAction() == NotifyAction.merge_begin)
+ if (info.getAction() == NotifyInformation.Action.merge_begin)
{
RevisionRange r = info.getMergeRange();
actualRange[0] = r.getFromRevision();
@@ -2540,7 +2539,7 @@ public class BasicTests extends SVNTests
String branchPath = thisTest.getWCPath() + "/branches/A";
String modUrl = thisTest.getUrl() + "/A";
- Revision unspec = new Revision(RevisionKind.unspecified);
+ Revision unspec = new Revision(Revision.Kind.unspecified);
List<RevisionRange> ranges = new ArrayList<RevisionRange>(1);
ranges.add(new RevisionRange(unspec, unspec));
client.merge(modUrl, Revision.HEAD, ranges,
@@ -2594,7 +2593,7 @@ public class BasicTests extends SVNTests
String branchPath = thisTest.getWCPath() + "/branches/A";
String modUrl = thisTest.getUrl() + "/A";
- Revision unspec = new Revision(RevisionKind.unspecified);
+ Revision unspec = new Revision(Revision.Kind.unspecified);
List<RevisionRange> ranges = new ArrayList<RevisionRange>(1);
ranges.add(new RevisionRange(unspec, unspec));
client.merge(modUrl, Revision.HEAD, ranges,
@@ -2655,7 +2654,7 @@ public class BasicTests extends SVNTests
{
public ConflictResult resolve(ConflictDescriptor descrip)
{
- return new ConflictResult(ConflictResult.chooseTheirsConflict,
+ return new ConflictResult(ConflictResult.Choice.chooseTheirsConflict,
null);
}
});
@@ -3069,10 +3068,10 @@ public class BasicTests extends SVNTests
assertEquals("Incorrect path for " + BETA_PATH, BETA_PATH,
betaDiff.getPath());
assertTrue("Incorrect diff kind for " + BETA_PATH,
- DiffSummary.DiffKind.ADDED.equals(betaDiff.getDiffKind()));
+ betaDiff.getDiffKind() == DiffSummary.DiffKind.added);
assertEquals("Incorrect props changed notice for " + BETA_PATH,
false, betaDiff.propsChanged());
- assertEquals("Incorrect node kind for " + BETA_PATH, 1,
+ assertEquals("Incorrect node kind for " + BETA_PATH, NodeKind.file,
betaDiff.getNodeKind());
}
@@ -3228,8 +3227,8 @@ public class BasicTests extends SVNTests
// we expect the tree conflict to turn the existing item into
// a scheduled-add with history. We expect the modifications in
// the local file to have been copied to the new file.
- tcTest.getWc().setItemTextStatus("A/B/E/alpha", StatusKind.added);
- tcTest.getWc().setItemTextStatus("A/B/F/alpha", StatusKind.modified);
+ tcTest.getWc().setItemTextStatus("A/B/E/alpha", Status.Kind.added);
+ tcTest.getWc().setItemTextStatus("A/B/F/alpha", Status.Kind.modified);
// check the status of the working copy of the tc test
tcTest.checkStatus();
@@ -3310,8 +3309,8 @@ public class BasicTests extends SVNTests
Status[] secondWCStatus = statusCallback.getStatusArray();
if (!(secondWCStatus.length == 1 &&
secondWCStatus[0].getPath().endsWith("A/B/lambda") &&
- secondWCStatus[0].getTextStatus() == StatusKind.modified &&
- secondWCStatus[0].getPropStatus() == StatusKind.none))
+ secondWCStatus[0].getTextStatus() == Status.Kind.modified &&
+ secondWCStatus[0].getPropStatus() == Status.Kind.none))
{
fail("Unexpected WC status after co with " +
"unversioned obstructions");
@@ -3458,25 +3457,6 @@ public class BasicTests extends SVNTests
*/
public void testCommitRevprops() throws Throwable
{
-
- class RevpropLogCallback implements LogMessageCallback
- {
- Map<String, byte[]> revprops;
-
- public void singleMessage(Set<ChangePath> changedPaths,
- long revision,
- Map<String, byte[]> revprops,
- boolean hasChildren)
- {
- this.revprops = revprops;
- }
-
- public Map<String, byte[]> getRevprops()
- {
- return revprops;
- }
- }
-
// build the test setup
OneTest thisTest = new OneTest();
@@ -3506,16 +3486,23 @@ public class BasicTests extends SVNTests
thisTest.checkStatus();
// Fetch our revprops from the server
- RevpropLogCallback callback = new RevpropLogCallback();
+ final List<Map<String, byte[]>> revpropList =
+ new ArrayList<Map<String, byte[]>>();
Set<String> revProps = new HashSet<String>(2);
revProps.add("kfogel");
revProps.add("cmpilato");
client.logMessages(thisTest.getWCPath(), Revision.getInstance(2),
- toRevisionRange(Revision.getInstance(2),
- Revision.getInstance(2)),
- false, false, false, revProps, 0,
- callback);
- Map<String, byte[]> fetchedProps = callback.getRevprops();
+ toRevisionRange(Revision.getInstance(2),
+ Revision.getInstance(2)),
+ false, false, false, revProps, 0,
+ new LogMessageCallback () {
+ public void singleMessage(Set<ChangePath> changedPaths,
+ long revision,
+ Map<String, byte[]> revprops,
+ boolean hasChildren)
+ { revpropList.add(revprops); }
+ });
+ Map<String, byte[]> fetchedProps = revpropList.get(0);
assertEquals("wrong number of fetched revprops", revprops.size(),
fetchedProps.size());
@@ -3615,22 +3602,6 @@ public class BasicTests extends SVNTests
}
}
- private class MyProplistCallback implements ProplistCallback
- {
- Map<String, Map<String, byte[]>> propMap =
- new HashMap<String, Map<String, byte[]>>();
-
- public void singlePath(String path, Map<String, byte[]> props)
- {
- propMap.put(path, props);
- }
-
- public Map<String, byte[]> getProperties(String path)
- {
- return propMap.get(path);
- }
- }
-
private class MyStatusCallback implements StatusCallback
{
private List<Status> statuses = new ArrayList<Status>();
@@ -3648,35 +3619,24 @@ public class BasicTests extends SVNTests
private Map<String, byte[]> collectProperties(String path,
Revision revision,
- Revision pegRevision, int depth,
+ Revision pegRevision, Depth depth,
Collection<String> changelists)
throws ClientException
{
- class MyProplistCallback implements ProplistCallback
- {
- Map<String, Map<String, byte[]>> propMap =
- new HashMap<String, Map<String, byte[]>>();
-
- public void singlePath(String path, Map<String, byte[]> props)
- {
- propMap.put(path, props);
- }
-
- public Map<String, byte[]> getProperties(String path)
- {
- return propMap.get(path);
- }
- }
-
- MyProplistCallback callback = new MyProplistCallback();
+ final Map<String, Map<String, byte[]>> propMap =
+ new HashMap<String, Map<String, byte[]>>();
+
client.properties(path, revision, revision, depth, changelists,
- callback);
+ new ProplistCallback () {
+ public void singlePath(String path, Map<String, byte[]> props)
+ { propMap.put(path, props); }
+ });
- return callback.getProperties(path);
+ return propMap.get(path);
}
private DirEntry[] collectDirEntries(String url, Revision revision,
- Revision pegRevision, int depth,
+ Revision pegRevision, Depth depth,
int direntFields, boolean fetchLocks)
throws ClientException
{
@@ -3725,29 +3685,18 @@ public class BasicTests extends SVNTests
}
private Info2[] collectInfos(String pathOrUrl, Revision revision,
- Revision pegRevision, int depth,
+ Revision pegRevision, Depth depth,
Collection<String> changelists)
throws ClientException
{
- class MyInfoCallback implements InfoCallback
- {
- private List<Info2> infos = new ArrayList<Info2>();
-
- public void singleInfo(Info2 info)
- {
- infos.add(info);
- }
-
- public Info2[] getInfoArray()
- {
- return infos.toArray(new Info2[infos.size()]);
- }
- }
-
- MyInfoCallback callback = new MyInfoCallback();
+ final List<Info2> infos = new ArrayList<Info2>();
+
client.info2(pathOrUrl, revision, pegRevision, depth, changelists,
- callback);
- return callback.getInfoArray();
+ new InfoCallback () {
+ public void singleInfo(Info2 info)
+ { infos.add(info); }
+ });
+ return infos.toArray(new Info2[infos.size()]);
}
private LogMessage[] collectLogMessages(String path, Revision pegRevision,
@@ -3829,6 +3778,67 @@ public class BasicTests extends SVNTests
return sb.toString().getBytes();
}
+ protected class LogMessage
+ {
+ private String message;
+
+ private long timeMicros;
+
+ private Date date;
+
+ private long revision;
+
+ private String author;
+
+ private Set<ChangePath> changedPaths;
+
+ LogMessage(Set<ChangePath> cp, long r, String a, long t, String m)
+ {
+ changedPaths = cp;
+ revision = r;
+ author = a;
+ timeMicros = t;
+ date = null;
+ message = m;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public long getTimeMicros()
+ {
+ return timeMicros;
+ }
+
+ public long getTimeMillis()
+ {
+ return timeMicros / 1000;
+ }
+
+ public Date getDate()
+ {
+ if (date == null)
+ date = new Date(timeMicros / 1000);
+ return date;
+ }
+
+ public long getRevisionNumber()
+ {
+ return revision;
+ }
+
+ public String getAuthor()
+ {
+ return author;
+ }
+
+ public Set<ChangePath> getChangedPaths()
+ {
+ return changedPaths;
+ }
+ }
/* A blame callback implementation. */
protected class BlameCallbackImpl implements BlameCallback
@@ -4042,5 +4052,5 @@ public class BasicTests extends SVNTests
sb.append(val);
}
}
- }
+ }
}
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Tue Mar 30 20:57:53 2010
@@ -46,7 +46,7 @@ class SVNTests extends TestCase
* our admin object, mostly used for creating,dumping and loading
* repositories
*/
- protected SVNAdmin admin;
+ protected ISVNAdmin admin;
/**
* the subversion client, what we want to test.
@@ -200,11 +200,11 @@ class SVNTests extends TestCase
if (this.fsType == null)
{
this.fsType =
- System.getProperty("test.fstype", SVNAdmin.FSFS).toLowerCase();
- if (!(SVNAdmin.FSFS.equals(this.fsType) ||
- SVNAdmin.BDB.equals(this.fsType)))
+ System.getProperty("test.fstype", ISVNAdmin.FSFS).toLowerCase();
+ if (!(ISVNAdmin.FSFS.equals(this.fsType) ||
+ ISVNAdmin.BDB.equals(this.fsType)))
{
- this.fsType = SVNAdmin.FSFS;
+ this.fsType = ISVNAdmin.FSFS;
}
}
@@ -379,7 +379,7 @@ class SVNTests extends TestCase
protected void addExpectedCommitItem(String workingCopyPath,
String baseUrl,
String itemPath,
- int nodeKind,
+ NodeKind nodeKind,
int stateFlags)
{
//determine the full working copy path and the full url of the item.
@@ -882,7 +882,7 @@ class SVNTests extends TestCase
/**
* the kind of node (file, directory or none, see NodeKind)
*/
- int myNodeKind;
+ NodeKind myNodeKind;
/**
* the reason why this item is commited (see CommitItemStateFlag)
*/
@@ -898,7 +898,7 @@ class SVNTests extends TestCase
* @param stateFlags the expected state flags
* @param url the expected url
*/
- private MyCommitItem(String path, int nodeKind, int stateFlags,
+ private MyCommitItem(String path, NodeKind nodeKind, int stateFlags,
String url)
{
myPath = path;
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/WC.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/WC.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/WC.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/WC.java Tue Mar 30 20:57:53 2010
@@ -92,7 +92,7 @@ public class WC
*/
public Item getItem(String path)
{
- return (Item) items.get(path);
+ return items.get(path);
}
/**
@@ -109,9 +109,9 @@ public class WC
* @param path the path, where the status is set
* @param status the new text status
*/
- public void setItemTextStatus(String path, int status)
+ public void setItemTextStatus(String path, Status.Kind status)
{
- ((Item) items.get(path)).textStatus = status;
+ items.get(path).textStatus = status;
}
/**
@@ -119,9 +119,9 @@ public class WC
* @param path the path, where the status is set
* @param status the new property status
*/
- public void setItemPropStatus(String path, int status)
+ public void setItemPropStatus(String path, Status.Kind status)
{
- ((Item) items.get(path)).propStatus = status;
+ items.get(path).propStatus = status;
}
/**
@@ -131,7 +131,7 @@ public class WC
*/
public void setItemWorkingCopyRevision(String path, long revision)
{
- ((Item) items.get(path)).workingCopyRev = revision;
+ items.get(path).workingCopyRev = revision;
}
/**
@@ -168,7 +168,7 @@ public class WC
// content or setting a former not set content is not allowed. That
// would change the type of the item.
Assert.assertNotNull("cannot unset content", content);
- Item i = (Item) items.get(path);
+ Item i = items.get(path);
Assert.assertNotNull("cannot set content on directory", i.myContent);
i.myContent = content;
}
@@ -180,8 +180,7 @@ public class WC
*/
public void setItemCheckContent(String path, boolean check)
{
- Item i = (Item) items.get(path);
- i.checkContent = check;
+ items.get(path).checkContent = check;
}
/**
@@ -189,10 +188,9 @@ public class WC
* @param path the path, where the node kind is set
* @param nodeKind the expected node kind
*/
- public void setItemNodeKind(String path, int nodeKind)
+ public void setItemNodeKind(String path, NodeKind nodeKind)
{
- Item i = (Item) items.get(path);
- i.nodeKind = nodeKind;
+ items.get(path).nodeKind = nodeKind;
}
/**
@@ -202,8 +200,7 @@ public class WC
*/
public void setItemIsLocked(String path, boolean isLocked)
{
- Item i = (Item) items.get(path);
- i.isLocked = isLocked;
+ items.get(path).isLocked = isLocked;
}
/**
@@ -213,8 +210,7 @@ public class WC
*/
public void setItemIsSwitched(String path, boolean isSwitched)
{
- Item i = (Item) items.get(path);
- i.isSwitched = isSwitched;
+ items.get(path).isSwitched = isSwitched;
}
/**
@@ -226,7 +222,7 @@ public class WC
*/
public void setItemReposLastCmtRevision(String path, long revision)
{
- ((Item) items.get(path)).reposLastCmtRevision = revision;
+ items.get(path).reposLastCmtRevision = revision;
}
/**
@@ -238,7 +234,7 @@ public class WC
*/
public void setItemReposLastCmtAuthor(String path, String author)
{
- ((Item) items.get(path)).reposLastCmtAuthor = author;
+ items.get(path).reposLastCmtAuthor = author;
}
/**
@@ -250,7 +246,7 @@ public class WC
*/
public void setItemReposLastCmtDate(String path, long date)
{
- ((Item) items.get(path)).reposLastCmtDate = date;
+ items.get(path).reposLastCmtDate = date;
}
/**
@@ -260,9 +256,9 @@ public class WC
* @param revision The last node kind for <code>path</code> known
* to the repository.
*/
- public void setItemReposKind(String path, int nodeKind)
+ public void setItemReposKind(String path, NodeKind nodeKind)
{
- ((Item) items.get(path)).reposKind = nodeKind;
+ items.get(path).reposKind = nodeKind;
}
/**
@@ -276,7 +272,7 @@ public class WC
* @param nodeKind The last node kind.
*/
public void setItemOODInfo(String path, long revision, String author,
- long date, int nodeKind)
+ long date, NodeKind nodeKind)
{
this.setItemReposLastCmtRevision(path, revision);
this.setItemReposLastCmtAuthor(path, author);
@@ -307,12 +303,12 @@ public class WC
void check(DirEntry[] tested, String singleFilePath)
{
Assert.assertEquals("not a single dir entry", 1, tested.length);
- Item item = (Item)items.get(singleFilePath);
+ Item item = items.get(singleFilePath);
Assert.assertNotNull("not found in working copy", item);
Assert.assertNotNull("not a file", item.myContent);
Assert.assertEquals("state says file, working copy not",
tested[0].getNodeKind(),
- item.nodeKind == -1 ? NodeKind.file : item.nodeKind);
+ item.nodeKind == null ? NodeKind.file : item.nodeKind);
}
/**
@@ -350,13 +346,13 @@ public class WC
{
Assert.assertEquals("Expected '" + entry + "' to be file",
entry.getNodeKind(),
- item.nodeKind == -1 ? NodeKind.file : item.nodeKind);
+ item.nodeKind == null ? NodeKind.file : item.nodeKind);
}
else
{
Assert.assertEquals("Expected '" + entry + "' to be dir",
entry.getNodeKind(),
- item.nodeKind == -1 ? NodeKind.dir : item.nodeKind);
+ item.nodeKind == null ? NodeKind.dir : item.nodeKind);
}
item.touched = true;
}
@@ -471,7 +467,7 @@ public class WC
{
Assert.assertEquals("state says file, working copy not: " + path,
status.getNodeKind(),
- item.nodeKind == -1 ? NodeKind.file : item.nodeKind);
+ item.nodeKind == null ? NodeKind.file : item.nodeKind);
if (status.getTextStatus() == Status.Kind.normal ||
item.checkContent)
{
@@ -493,7 +489,7 @@ public class WC
{
Assert.assertEquals("state says dir, working copy not: " + path,
status.getNodeKind(),
- item.nodeKind == -1 ? NodeKind.dir : item.nodeKind);
+ item.nodeKind == null ? NodeKind.dir : item.nodeKind);
}
if (checkRepos)
@@ -553,12 +549,12 @@ public class WC
/**
* the text (content) status of the item
*/
- int textStatus = Status.Kind.normal;
+ Status.Kind textStatus = Status.Kind.normal;
/**
* the property status of the item.
*/
- int propStatus = Status.Kind.none;
+ Status.Kind propStatus = Status.Kind.none;
/**
* the expected revision number. -1 means do not check.
@@ -576,9 +572,9 @@ public class WC
boolean checkContent;
/**
- * expected node kind. -1 means do not check.
+ * expected node kind. null means do not check.
*/
- int nodeKind = -1;
+ NodeKind nodeKind = null;
/**
* expected locked status
@@ -603,7 +599,7 @@ public class WC
/**
* node kind of the youngest commit if out of date
*/
- int reposKind = NodeKind.none;
+ NodeKind reposKind = NodeKind.none;
/**
* author of the youngest commit if out of date.
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java Tue Mar 30 20:57:53 2010
@@ -2247,7 +2247,7 @@ public class BasicTests extends SVNTests
private long[] getMergeinfoRevisions(int kind, String pathOrUrl,
Revision pegRevision,
String mergeSourceUrl,
- Revision srcPegRevision)
+ Revision srcPegRevision)
throws SubversionException
{
class Callback implements LogMessageCallback {
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/INSTALL?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/INSTALL (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/INSTALL Tue Mar 30 20:57:53 2010
@@ -1,4 +1,4 @@
- -*-text-*-
+ -*-text-*-
STATUS OF THE SWIG BINDINGS
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/NOTES
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/NOTES?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/NOTES (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/NOTES Tue Mar 30 20:57:53 2010
@@ -1,4 +1,4 @@
- -*-text-*-
+ -*-text-*-
==> For instructions on how to get swig bindings working, read the
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/core.i?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/core.i (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/core.i Tue Mar 30 20:57:53 2010
@@ -785,6 +785,10 @@ svn_swig_pl_set_current_pool (apr_pool_t
#endif
#ifdef SWIGPERL
+/* The apr_file_t* 'in' typemap can't cope with struct members, and there
+ is no reason to change this one. */
+%immutable svn_patch_t::patch_file;
+
%include svn_diff_h.swg
%include svn_error_h.swg
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c Tue Mar 30 20:57:53 2010
@@ -1145,7 +1145,7 @@ svn_swig_py_unwrap_string(PyObject *sour
{
const char **ptr_dest = destination;
*ptr_dest = PyString_AsString(source);
-
+
if (*ptr_dest != NULL)
return 0;
else
@@ -1238,7 +1238,7 @@ svn_swig_py_seq_to_array(PyObject *seq,
if (o == NULL)
return NULL;
-
+
elt_ptr = apr_array_push(temp);
status = unwrap_func(o, elt_ptr, unwrap_baton);
Py_DECREF(o);
@@ -1320,11 +1320,57 @@ commit_item_array_to_list(const apr_arra
/*** Errors ***/
-/* Return a Subversion error about a failed callback. */
+/* If the currently set Python exception is a valid SubversionException,
+ clear exception state and transform it into a Subversion error.
+ Otherwise, return a Subversion error about an exception in a callback. */
static svn_error_t *callback_exception_error(void)
{
- return svn_error_create(SVN_ERR_SWIG_PY_EXCEPTION_SET, NULL,
- "Python callback raised an exception");
+ PyObject *svn_module = NULL, *svn_exc = NULL;
+ PyObject *exc, *exc_type, *exc_traceback;
+ PyObject *message_ob = NULL, *apr_err_ob = NULL;
+ const char *message;
+ int apr_err;
+ svn_error_t *rv = NULL;
+
+ PyErr_Fetch(&exc_type, &exc, &exc_traceback);
+
+ if ((svn_module = PyImport_ImportModule("svn.core")) == NULL)
+ goto finished;
+ if ((svn_exc = PyObject_GetAttrString(svn_module, "SubversionException"))
+ == NULL)
+ goto finished;
+
+ if (!PyErr_GivenExceptionMatches(exc_type, svn_exc))
+ {
+ PyErr_Restore(exc_type, exc, exc_traceback);
+ exc = exc_type = exc_traceback = NULL;
+ goto finished;
+ }
+
+ if ((apr_err_ob = PyObject_GetAttrString(exc, "apr_err")) == NULL)
+ goto finished;
+ apr_err = PyInt_AsLong(apr_err_ob);
+ if (PyErr_Occurred()) goto finished;
+
+ if ((message_ob = PyObject_GetAttrString(exc, "message")) == NULL)
+ goto finished;
+ message = PyString_AsString(message_ob);
+ if (PyErr_Occurred()) goto finished;
+
+ /* A possible improvement here would be to convert the whole
+ SubversionException chain. */
+ rv = svn_error_create(apr_err, NULL, message);
+
+finished:
+ Py_XDECREF(exc);
+ Py_XDECREF(exc_type);
+ Py_XDECREF(exc_traceback);
+ Py_XDECREF(svn_module);
+ Py_XDECREF(svn_exc);
+ Py_XDECREF(apr_err_ob);
+ Py_XDECREF(message_ob);
+ return rv ? rv : svn_error_create(SVN_ERR_SWIG_PY_EXCEPTION_SET, NULL,
+ "Python callback raised an exception");
}
/* Raise a TypeError exception with MESSAGE, and return a Subversion
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/auth.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/auth.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/auth.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/auth.py Tue Mar 30 20:57:53 2010
@@ -18,7 +18,7 @@
# under the License.
#
#
-import unittest, os, setup_path, sys
+import unittest, setup_path
from svn import core
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/client.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/client.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/client.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/client.py Tue Mar 30 20:57:53 2010
@@ -20,9 +20,7 @@
#
import unittest, os, weakref, tempfile, setup_path
-from svn import core, repos, fs, delta, client, wc
-from svn.core import SubversionException
-import weakref
+from svn import core, client, wc
from trac.versioncontrol.tests.svn_fs import SubversionRepositoryTestSetup, \
REPOS_PATH, REPOS_URL
@@ -78,8 +76,8 @@ class SubversionClientTestCase(unittest.
# We have to free client_ctx first, since it may be holding handles
# to WC DBs
del self.client_ctx
- for dir in self.cleanup_dirs:
- core.svn_io_remove_dir(dir)
+ for directory in self.cleanup_dirs:
+ core.svn_io_remove_dir(directory)
def allocate_temp_dir(self, suffix = ""):
temp_dir_name = core.svn_dirent_internal_style(tempfile.mkdtemp(suffix))
@@ -194,30 +192,30 @@ class SubversionClientTestCase(unittest.
def test_mkdir_url(self):
"""Test svn_client_mkdir2 on a file:// URL"""
- dir = urljoin(REPOS_URL+"/", "dir1")
+ directory = urljoin(REPOS_URL+"/", "dir1")
- commit_info = client.mkdir2((dir,), self.client_ctx)
+ commit_info = client.mkdir2((directory,), self.client_ctx)
self.assertEqual(commit_info.revision, 13)
self.assertEqual(self.log_message_func_calls, 1)
def test_mkdir_url_with_revprops(self):
"""Test svn_client_mkdir3 on a file:// URL, with added revprops"""
- dir = urljoin(REPOS_URL+"/", "some/deep/subdir")
+ directory = urljoin(REPOS_URL+"/", "some/deep/subdir")
- commit_info = client.mkdir3((dir,), 1, {'customprop':'value'},
+ commit_info = client.mkdir3((directory,), 1, {'customprop':'value'},
self.client_ctx)
self.assertEqual(commit_info.revision, 14)
self.assertEqual(self.log_message_func_calls, 1)
def test_log3_url(self):
"""Test svn_client_log3 on a file:// URL"""
- dir = urljoin(REPOS_URL+"/", "trunk/dir1")
+ directory = urljoin(REPOS_URL+"/", "trunk/dir1")
start = core.svn_opt_revision_t()
end = core.svn_opt_revision_t()
core.svn_opt_parse_revision(start, end, "4:0")
- client.log3((dir,), start, start, end, 1, True, False, self.log_receiver,
- self.client_ctx)
+ client.log3((directory,), start, start, end, 1, True, False,
+ self.log_receiver, self.client_ctx)
self.assertEqual(self.change_author, "john")
self.assertEqual(self.log_message, "More directories.")
self.assertEqual(len(self.changed_paths), 3)
@@ -363,11 +361,11 @@ class SubversionClientTestCase(unittest.
end.kind = core.svn_opt_revision_number
end.value.number = 9
- range = core.svn_opt_revision_range_t()
- range.start = start
- range.end = end
+ rrange = core.svn_opt_revision_range_t()
+ rrange.start = start
+ rrange.end = end
- client.merge_peg3(v1x_path, (range,), end, trunk_path,
+ client.merge_peg3(v1x_path, (rrange,), end, trunk_path,
core.svn_depth_infinity, False, False, False, False,
None, self.client_ctx)
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/core.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/core.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/core.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/core.py Tue Mar 30 20:57:53 2010
@@ -18,7 +18,7 @@
# under the License.
#
#
-import unittest, os
+import unittest
import svn.core
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/delta.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/delta.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/delta.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/delta.py Tue Mar 30 20:57:53 2010
@@ -34,8 +34,8 @@ class DeltaTestCase(unittest.TestCase):
def testTxWindowHandler(self):
"""Test tx_invoke_window_handler"""
- src_stream = StringIO("hello world");
- target_stream = StringIO("bye world");
+ src_stream = StringIO("hello world")
+ target_stream = StringIO("bye world")
# Invoke the window_handler using a helper function
window_handler, baton = \
@@ -52,4 +52,4 @@ def suite():
if __name__ == '__main__':
runner = unittest.TextTestRunner()
- runner.run(suite());
+ runner.run(suite())
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/mergeinfo.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/mergeinfo.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/mergeinfo.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/mergeinfo.py Tue Mar 30 20:57:53 2010
@@ -32,7 +32,6 @@ else:
from StringIO import StringIO
from svn import core, repos, fs
-from svn.core import SubversionException
from trac.versioncontrol.tests.svn_fs import REPOS_PATH
@@ -101,13 +100,13 @@ class SubversionMergeinfoTestCase(unitte
def test_rangelist_reverse(self):
mergeinfo = core.svn_mergeinfo_parse(self.TEXT_MERGEINFO1)
rangelist = mergeinfo.get(self.MERGEINFO_SRC)
- reversed = core.svn_rangelist_reverse(rangelist)
+ reversed_rl = core.svn_rangelist_reverse(rangelist)
expected_ranges = ((42, 41), (27, 26), (9, 2))
- for i in range(0, len(reversed)):
- self.assertEquals(reversed[i].start, expected_ranges[i][0],
- "Unexpected range start: %d" % reversed[i].start)
- self.assertEquals(reversed[i].end, expected_ranges[i][1],
- "Unexpected range end: %d" % reversed[i].end)
+ for i in range(0, len(reversed_rl)):
+ self.assertEquals(reversed_rl[i].start, expected_ranges[i][0],
+ "Unexpected range start: %d" % reversed_rl[i].start)
+ self.assertEquals(reversed_rl[i].end, expected_ranges[i][1],
+ "Unexpected range end: %d" % reversed_rl[i].end)
def test_mergeinfo_sort(self):
mergeinfo = core.svn_mergeinfo_parse(self.TEXT_MERGEINFO1)
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/pool.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/pool.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/pool.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/pool.py Tue Mar 30 20:57:53 2010
@@ -30,11 +30,11 @@ class PoolTestCase(unittest.TestCase):
def assertNotNone(self, value):
"""Assert that the specified value is not None"""
- return self.assertNotEqual(value, None);
+ return self.assertNotEqual(value, None)
def assertNone(self, value):
"""Assert that the specified value is None"""
- return self.assertEqual(value, None);
+ return self.assertEqual(value, None)
def test_object_struct_members(self):
"""Check that object struct members work correctly"""
@@ -133,7 +133,7 @@ class PoolTestCase(unittest.TestCase):
pool = Pool(pool)
# Make sure proper exceptions are raised with incorrect input
- self.assertRaises(TypeError, lambda: Pool("abcd"));
+ self.assertRaises(TypeError, lambda: Pool("abcd"))
# Check that garbage collection is working OK
self.assertNotNone(parent_pool_ref())
@@ -165,7 +165,7 @@ class PoolTestCase(unittest.TestCase):
pool_ref = weakref.ref(pool)
# Make sure proper exceptions are raised with incorrect input
- self.assertRaises(TypeError, lambda: svn_pool_create("abcd"));
+ self.assertRaises(TypeError, lambda: svn_pool_create("abcd"))
# Test whether pools are destroyed properly
pool = svn_pool_create(pool)
@@ -180,7 +180,7 @@ class PoolTestCase(unittest.TestCase):
newpool2 = Pool(newpool)
svn_pool_clear(newpool)
self.assertRaises(AssertionError, lambda: libsvn.core.apr_pool_destroy(newpool2))
- self.assertRaises(AssertionError, lambda: svn_pool_destroy(newpool2));
+ self.assertRaises(AssertionError, lambda: svn_pool_destroy(newpool2))
svn_pool_destroy(newpool)
self.assertRaises(AssertionError, lambda: svn_pool_destroy(newpool))
@@ -207,7 +207,7 @@ class PoolTestCase(unittest.TestCase):
self.assertNone(libsvn.core.application_pool)
# Try to allocate memory from the old application pool
- self.assertRaises(AssertionError, lambda: svn_pool_create(application_pool));
+ self.assertRaises(AssertionError, lambda: svn_pool_create(application_pool))
# Bring the application pool back to life
svn_pool_create()
@@ -223,4 +223,4 @@ def suite():
if __name__ == '__main__':
runner = unittest.TextTestRunner()
- runner.run(suite());
+ runner.run(suite())
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/ra.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/ra.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/ra.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/ra.py Tue Mar 30 20:57:53 2010
@@ -18,9 +18,9 @@
# under the License.
#
#
-import unittest, os, setup_path
+import unittest, setup_path
-from svn import core, repos, fs, delta, client, ra
+from svn import core, repos, fs, delta, ra
from sys import version_info # For Python version check
if version_info[0] >= 3:
# Python >=3.0
@@ -83,10 +83,10 @@ class SubversionRepositoryAccessTestCase
def test_get_latest_revnum(self):
ra_revnum = ra.get_latest_revnum(self.ra_ctx)
fs_revnum = fs.youngest_rev(self.fs)
- self.assertEqual(ra_revnum,fs_revnum)
+ self.assertEqual(ra_revnum, fs_revnum)
def test_get_dir2(self):
- (dirents,_,props) = ra.get_dir2(self.ra_ctx, '', 1, core.SVN_DIRENT_KIND)
+ (dirents, _, props) = ra.get_dir2(self.ra_ctx, '', 1, core.SVN_DIRENT_KIND)
self.assert_('trunk' in dirents)
self.assert_('branches' in dirents)
self.assert_('tags' in dirents)
@@ -96,14 +96,14 @@ class SubversionRepositoryAccessTestCase
self.assert_(core.SVN_PROP_ENTRY_UUID in props)
self.assert_(core.SVN_PROP_ENTRY_LAST_AUTHOR in props)
- (dirents,_,_) = ra.get_dir2(self.ra_ctx, 'trunk', 1, core.SVN_DIRENT_KIND)
+ (dirents, _, _) = ra.get_dir2(self.ra_ctx, 'trunk', 1, core.SVN_DIRENT_KIND)
self.assertEqual(dirents, {})
- (dirents,_,_) = ra.get_dir2(self.ra_ctx, 'trunk', 10, core.SVN_DIRENT_KIND)
+ (dirents, _, _) = ra.get_dir2(self.ra_ctx, 'trunk', 10, core.SVN_DIRENT_KIND)
self.assert_('README2.txt' in dirents)
- self.assertEqual(dirents['README2.txt'].kind,core.svn_node_file)
+ self.assertEqual(dirents['README2.txt'].kind, core.svn_node_file)
def test_commit3(self):
commit_info = []
@@ -238,7 +238,7 @@ class SubversionRepositoryAccessTestCase
def __init__(self):
self.textdeltas = []
- def apply_textdelta(self, file_baton, base_checksum):
+ def apply_textdelta(self, file_baton, base_checksum, pool=None):
def textdelta_handler(textdelta):
if textdelta is not None:
self.textdeltas.append(textdelta)
@@ -266,7 +266,7 @@ class SubversionRepositoryAccessTestCase
self.assertEqual(1, len(editor.textdeltas))
def test_get_locations(self):
- locations = ra.get_locations(self.ra_ctx, "trunk/README.txt", 2, list(range(1,5)))
+ locations = ra.get_locations(self.ra_ctx, "trunk/README.txt", 2, list(range(1, 5)))
self.assertEqual(locations, {
2: '/trunk/README.txt',
3: '/trunk/README.txt',
@@ -382,7 +382,7 @@ class SubversionRepositoryAccessTestCase
called[0] = True
return 'namestring_test'
self.callbacks.get_client_string = cb
- svn.ra.stat(self.ra_ctx, "", 1)
+ ra.stat(self.ra_ctx, "", 1)
self.assert_(called[0])
def suite():
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/repository.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/repository.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/repository.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/repository.py Tue Mar 30 20:57:53 2010
@@ -18,7 +18,7 @@
# under the License.
#
#
-import unittest, os, setup_path, tempfile
+import unittest, setup_path, tempfile
from sys import version_info # For Python version check
if version_info[0] >= 3:
# Python >=3.0
@@ -40,7 +40,7 @@ class ChangeReceiver(delta.Editor):
self.tgt_root = tgt_root
self.textdeltas = []
- def apply_textdelta(self, file_baton, base_checksum):
+ def apply_textdelta(self, file_baton, base_checksum, pool=None):
def textdelta_handler(textdelta):
if textdelta is not None:
self.textdeltas.append(textdelta)
@@ -63,6 +63,19 @@ class SubversionRepositoryTestCase(unitt
self.fs = None
self.repos = None
+ def test_cease_invocation(self):
+ """Test returning SVN_ERR_CEASE_INVOCATION from a callback"""
+
+ revs = []
+ def history_lookup(path, rev, pool):
+ revs.append(rev)
+ raise core.SubversionException(apr_err=core.SVN_ERR_CEASE_INVOCATION,
+ message="Hi from history_lookup")
+
+ repos.history2(self.fs, '/trunk/README2.txt', history_lookup, None, 0,
+ self.rev, True)
+ self.assertEqual(len(revs), 1)
+
def test_create(self):
"""Make sure that repos.create doesn't segfault when we set fs-type
using a config hash"""
@@ -160,7 +173,7 @@ class SubversionRepositoryTestCase(unitt
# Check results
self.assertEqual(editor.textdeltas[0].new_data, "This is a test.\n")
self.assertEqual(editor.textdeltas[1].new_data, "A test.\n")
- self.assertEqual(len(editor.textdeltas),2)
+ self.assertEqual(len(editor.textdeltas), 2)
def test_retrieve_and_change_rev_prop(self):
"""Test playing with revprops"""
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/run_all.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/run_all.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/run_all.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/run_all.py Tue Mar 30 20:57:53 2010
@@ -18,7 +18,7 @@
# under the License.
#
#
-import sys, os, unittest, setup_path
+import unittest, setup_path
import mergeinfo, core, client, delta, pool, ra, wc, repository, auth, \
trac.versioncontrol.tests
@@ -26,18 +26,18 @@ import mergeinfo, core, client, delta, p
def suite():
"""Run all tests"""
- suite = unittest.TestSuite()
- suite.addTest(core.suite())
- suite.addTest(mergeinfo.suite())
- suite.addTest(client.suite())
- suite.addTest(delta.suite())
- suite.addTest(pool.suite())
- suite.addTest(ra.suite())
- suite.addTest(wc.suite())
- suite.addTest(repository.suite())
- suite.addTest(auth.suite())
- suite.addTest(trac.versioncontrol.tests.suite());
- return suite
+ s = unittest.TestSuite()
+ s.addTest(core.suite())
+ s.addTest(mergeinfo.suite())
+ s.addTest(client.suite())
+ s.addTest(delta.suite())
+ s.addTest(pool.suite())
+ s.addTest(ra.suite())
+ s.addTest(wc.suite())
+ s.addTest(repository.suite())
+ s.addTest(auth.suite())
+ s.addTest(trac.versioncontrol.tests.suite())
+ return s
if __name__ == '__main__':
unittest.main(defaultTest='suite')
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/wc.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/wc.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/python/tests/wc.py Tue Mar 30 20:57:53 2010
@@ -25,7 +25,7 @@ if version_info[0] >= 3:
else:
# Python <3.0
from cStringIO import StringIO
-import unittest, os, tempfile, shutil, setup_path, binascii
+import unittest, os, tempfile, setup_path, binascii
import svn.diff
from svn import core, repos, wc, client
from svn import delta, ra
@@ -62,7 +62,7 @@ class SubversionWorkingCopyTestCase(unit
self.wc = wc.adm_open3(None, self.path, True, -1, None)
def test_entry(self):
- wc_entry = wc.entry(self.path, self.wc, True)
+ wc.entry(self.path, self.wc, True)
def test_lock(self):
readme_path = '%s/trunk/README.txt' % self.path
@@ -112,13 +112,13 @@ class SubversionWorkingCopyTestCase(unit
class MyReporter:
def __init__(self):
- self._finished_report = False
+ self.finished_report = False
def abort_report(self, pool):
pass
def finish_report(self, pool):
- self._finished_report = True
+ self.finished_report = True
def set_path(self, path, revision, start_empty, lock_token, pool):
set_paths.append(path)
@@ -142,7 +142,7 @@ class SubversionWorkingCopyTestCase(unit
True, True, False, notify, info)
# Check that the report finished
- self.assert_(reporter._finished_report)
+ self.assert_(reporter.finished_report)
self.assertEqual([''], set_paths)
self.assertEqual(1, len(infos))
@@ -333,7 +333,7 @@ class SubversionWorkingCopyTestCase(unit
got_prop_changes = []
def props_changed(path, propchanges):
for (name, value) in propchanges.items():
- (kind, unused_prefix_len) = core.svn_property_kind(name)
+ (kind, _) = core.svn_property_kind(name)
if kind != core.svn_prop_regular_kind:
continue
got_prop_changes.append((path[len(self.path) + 1:], name, value))
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/swig/ruby/svn/wc.rb
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/swig/ruby/svn/wc.rb?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/swig/ruby/svn/wc.rb (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/swig/ruby/svn/wc.rb Tue Mar 30 20:57:53 2010
@@ -725,7 +725,7 @@ module Svn
return context
end
- # Creates an new instance of Context for use in the block, the context
+ # Creates an new instance of Context for use in the block, the context
# is destroyed when the block completes.
#
# ==== arguments