|
58 | 58 | import org.tigris.subversion.svnclientadapter.SVNRevisionRange; |
59 | 59 | import org.tigris.subversion.svnclientadapter.SVNScheduleKind; |
60 | 60 | import org.tigris.subversion.svnclientadapter.SVNStatusUnversioned; |
61 | | -import org.tigris.subversion.svnclientadapter.SVNUrl; |
62 | 61 |
|
63 | 62 | /** |
64 | 63 | * <p> |
@@ -1007,14 +1006,43 @@ public void propertySet(File path, String propertyName, String propertyValue, bo |
1007 | 1006 | } |
1008 | 1007 | } |
1009 | 1008 |
|
1010 | | - /** |
1011 | | - * A safe <code>toString()</code> implementation which implements |
1012 | | - * <code>null</code> checking on <code>obj</code>. |
1013 | | - */ |
1014 | | - protected static String toString(Object obj) { |
1015 | | - return (obj == null) ? null : obj.toString(); |
| 1009 | + protected static String toString(SVNRevision r) { |
| 1010 | + return (r == null) ? null : r.toString(); |
| 1011 | + } |
| 1012 | + |
| 1013 | + protected static String toString(File f) { |
| 1014 | + return (f == null) ? null : atSign(f.toString()); |
| 1015 | + } |
| 1016 | + |
| 1017 | + protected static String toString(File[] f) { |
| 1018 | + if (f == null) return null; |
| 1019 | + StringBuffer buf = new StringBuffer(); |
| 1020 | + for (int i = 0; i < f.length; i++) { |
| 1021 | + buf.append(atSign(f[i].toString()) + " "); |
| 1022 | + } |
| 1023 | + return buf.toString(); |
1016 | 1024 | } |
1017 | 1025 |
|
| 1026 | + protected static String toString(SVNUrl u) { |
| 1027 | + return (u == null) ? null : atSign(u.toString()); |
| 1028 | + } |
| 1029 | + |
| 1030 | + /** |
| 1031 | + * The command line requires paths that contain an '@' |
| 1032 | + * have an '@' at the end of the string. Otherwise it |
| 1033 | + * interprets the '@' as the start of a peg revision |
| 1034 | + * |
| 1035 | + * Rather than always add an '@' to end of path we use |
| 1036 | + * this method to only do so when needed. |
| 1037 | + */ |
| 1038 | + private static String atSign(String s) { |
| 1039 | + if (s.contains("@")) |
| 1040 | + return s + "@"; |
| 1041 | + else |
| 1042 | + return s; |
| 1043 | + } |
| 1044 | + |
| 1045 | + |
1018 | 1046 | /** |
1019 | 1047 | * Implementation used by overloads of <code>getLogMessages()</code>. |
1020 | 1048 | * |
|
0 commit comments