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

Re: [Issue 2723] 'diff' output always contains absolute path names

From: Daniel L. Rall <dlr_at_finemaltcoding.com>
Date: 2007-11-14 06:18:05 CET

On Wed, 14 Nov 2007, jwhitlock@tigris.org wrote:

> http://subversion.tigris.org/issues/show_bug.cgi?id=2723
>
> ------- Additional comments from jwhitlock@tigris.org Tue Nov 13 20:41:30 -0800 2007 -------
> Attached next revision of Issue 2723 patch. Patch now completely outputs the proper diff output relative
> to a path and is unified diff compliant.

Comments inline below.

[[[
Added support to libsvn_client and libsvn_diff to allow consumers the ability
to print unified diff paths relative to a particular directory path. JavaHL
has been updated to take advantage of this new functionality per Issue 2723.

* subversion/include/svn_client.h
  (svn_client_diff4, svn_client_diff_peg4): Add new relative_to_dir argument.

* subversion/include/svn_diff.h
  (normalize_outputted_diff_path): New function.

-> APIs declared in this header file should typically use the "svn_diff_"
prefix. However, I'm unconvinced that this API belongs in the public
interface.

  (svn_diff_file_output_unified): Revved to svn_diff_file_output_unified3()
  for new relative_to_dir argument.

-> Was this actually the svn_diff_file_output_unified2 symbol?

* subversion/libsvn_client/diff.c
  (diff_cmd_baton): Added relative_to_dir member.
  (diff_content_changed, diff_file_deleted_no_diff, svn_client_diff4,
  svn_client_diff_peg4): Added support for new relative_to_dir diff_cmd_baton
  member.

-> One more char of indent for the above two lines.

  (svn_client_diff3, svn_client_diff_peg3): Updated to handle relative_to_dir
  argument in revved functions.

* subversion/libsvn_diff/diff_file.c
  (svn_diff_file_output_unified): Implementation of
  svn_diff_file_output_unified3 which handles relative_to_dir argument.

* subversion/libsvn_diff/util.c
  (normalize_outputted_diff_path): New function.

* subversion/svn/diff-cmd.c
  (svn_cl__diff): Updated to called revved versions of svn_client_diff and
  svn_client_diff_peg.

* subversion/bindings/javahl/native/SVNClient.h
  (diff): Add new relativeToDir argument.

* subversion/bindings/javahl/native/SVNClient.cpp
  (diff): Add new relativeToDir argument.

* subversion/bindings/javahl/native/org_tigris_subversion_javahl_SVNClient.cpp
  (diff): Add new jrelativeToDir argument.

* subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
  (diff): Add new relativeToDir argument.

* subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientSynchronized.java
  (diff): Add new relativeToDir argument.

* subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java
  (diff): Add new relativeToDir argument.

* subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java
  (testDiff): Unit tests.
]]]

Index: subversion/include/svn_diff.h
===================================================================
--- subversion/include/svn_diff.h (revision 27805)
+++ subversion/include/svn_diff.h (working copy)
@@ -58,6 +58,16 @@
 
 
 
+
+/* A helper function to determine the outputted path used in
+ * the index and header of the unified diff. If RELATIVE_TO_DIR
+ * is NULL, path is returned unmodified. If RELATIVE_TO_DIR is
+ * not NULL, this function will check to see if RELATIVE_TO_DIR
+ * is prexent at index 0 of PATH and will return PATH with
+ * RELATIVE_TO_DIR stripped from the beginning of PATH. (Issue 2723) */

As this is in the public header file, it should use the header file prefix
and Doxygen-formatted documentation (headed by /**).

+const char *
+normalize_outputted_diff_path(const char *path, const char *relative_to_dir);
+
 /**
  * Get libsvn_diff version information.
  *
@@ -460,7 +470,7 @@
 /** A convenience function to produce unified diff output from the
  * diff generated by svn_diff_file_diff().
  *
- * @since New in 1.3.
+ * @since New in 1.5.
  *
  * Output a @a diff between @a original_path and @a modified_path in unified
  * context diff format to @a output_stream. Optionally supply

The new relative_to_dir parameter needs documentation, which should indicate
the behavior when @c NULL is passed.

@@ -470,6 +480,22 @@
  * Output all headers and markers in @a header_encoding.
  */
 svn_error_t *
+svn_diff_file_output_unified3(svn_stream_t *output_stream,
+ svn_diff_t *diff,
+ const char *original_path,
+ const char *modified_path,
+ const char *original_header,
+ const char *modified_header,
+ const char *header_encoding,
+ const char *relative_to_dir,
+ apr_pool_t *pool);
+
+/** Similar to svn_diff_file_output_unified3(), but with @a relative_to_dir
+ * set to NULL.
+ *
+ * @deprecated Provided for backwards compatibility with the 1.4 API.

This should be 1.3, rather than 1.4.

+ */
+svn_error_t *
 svn_diff_file_output_unified2(svn_stream_t *output_stream,
                               svn_diff_t *diff,
                               const char *original_path,
Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h (revision 27805)
+++ subversion/include/svn_client.h (working copy)
@@ -1994,6 +1994,10 @@
  * of the diff to @a outfile, and any errors to @a errfile. @a path1
  * and @a path2 can be either working-copy paths or URLs.
  *
+ * If @a relative_to_dir is not NULL, the path index will be relative
+ * to that directory path. If @a relative_to_dir is NULL, path index
+ * will be created just as Subversion did pre-1.5.

How about: "will be created just as by pre-1.5 versions."

+ *
  * If either @a revision1 or @a revision2 has an `unspecified' or
  * unrecognized `kind', return @c SVN_ERR_CLIENT_BAD_REVISION.
  *
@@ -2035,6 +2039,9 @@
  * @note @a header_encoding doesn't affect headers generated by external
  * diff programs.
  *
+ * @note @a relative_to_dir doesn't affect the path index generated by
+ * external diff programs.
+ *
  * @since New in 1.5.
  */
 svn_error_t *svn_client_diff4(const apr_array_header_t *diff_options,
@@ -2050,6 +2057,7 @@
                               apr_file_t *outfile,
                               apr_file_t *errfile,
                               svn_client_ctx_t *ctx,
+ const char *relative_to_dir,
                               apr_pool_t *pool);
 
 
@@ -2147,6 +2155,7 @@
                                   apr_file_t *outfile,
                                   apr_file_t *errfile,
                                   svn_client_ctx_t *ctx,
+ const char *relative_to_dir,
                                   apr_pool_t *pool);
 
 /**
Index: subversion/libsvn_diff/diff_file.c
===================================================================
--- subversion/libsvn_diff/diff_file.c (revision 27805)
+++ subversion/libsvn_diff/diff_file.c (working copy)
@@ -1075,13 +1075,14 @@
 };
 
 svn_error_t *
-svn_diff_file_output_unified2(svn_stream_t *output_stream,
+svn_diff_file_output_unified3(svn_stream_t *output_stream,
                               svn_diff_t *diff,
                               const char *original_path,
                               const char *modified_path,
                               const char *original_header,
                               const char *modified_header,
                               const char *header_encoding,
+ const char *relative_to_dir,
                               apr_pool_t *pool)
 {
   svn_diff__file_output_baton_t baton;
@@ -1125,7 +1126,8 @@
       SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding, pool,
                                           "--- %s" APR_EOL_STR
                                           "+++ %s" APR_EOL_STR,
- original_header, modified_header));
+ normalize_outputted_diff_path(original_header, relative_to_dir),
+ normalize_outputted_diff_path(modified_header, relative_to_dir)));
 
       SVN_ERR(svn_diff_output(diff, &baton,
                               &svn_diff__file_output_unified_vtable));
@@ -1141,6 +1143,22 @@
 }
 
 svn_error_t *
+svn_diff_file_output_unified2(svn_stream_t *output_stream,
+ svn_diff_t *diff,
+ const char *original_path,
+ const char *modified_path,
+ const char *original_header,
+ const char *modified_header,
+ const char *header_encoding,
+ apr_pool_t *pool)
+{
+ return svn_diff_file_output_unified3(output_stream, diff,
+ original_path, modified_path,
+ original_header, modified_header,
+ header_encoding, NULL, pool);
+}
+
+svn_error_t *
 svn_diff_file_output_unified(svn_stream_t *output_stream,
                              svn_diff_t *diff,
                              const char *original_path,
ndex: subversion/libsvn_diff/util.c
===================================================================
--- subversion/libsvn_diff/util.c (revision 27805)
+++ subversion/libsvn_diff/util.c (working copy)
@@ -394,3 +394,42 @@
 {
   SVN_VERSION_BODY;
 }
+
+/* A helper function to determine the Index path of diff's
+ output. If RELATIVE_TO_DIR is NULL, path is returned
+ unmodified. If RELATIVE_TO_DIR is not NULL, this function
+ will check to see if RELATIVE_TO_DIR is prexent at index 0
+ of PATH and will return PATH with RELATIVE_TO_DIR stripped
+ from the beginning of PATH. (Issue 2723) */
+const char *
+normalize_outputted_diff_path(const char *path, const char *relative_to_dir)
+{
+ char *position;
+ int i;
+
+ /* Check that we should be manipulating the index. */
+ if (! relative_to_dir)
+ return path;
+
+ /* Make sure path and relative_to_dir are not equal. */
+ if (! strcmp(path, relative_to_dir))
+ return path;
+
+ position = strstr(path, relative_to_dir);
+
+ /* Make sure the relative_to_dir was found in the path. */
+ if (position == NULL)
+ return path;
+
+ i = path - position;
+
+ /* Make sure relative_to_dir was found at index 0. */
+ if (i != 0)
+ return path;
+
+ /* Handle paths with and without trailing slash appropriately. */
+ if (relative_to_dir[strlen(relative_to_dir) -1] == '/')
+ return &path[strlen(relative_to_dir)];
+ else
+ return &path[strlen(relative_to_dir) + 1];
+}

It'd be great to have a C unit test for this API, which seems like it might
find a better home in svn_path.h (or include/private/ equivalent).

Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c (revision 27805)
+++ subversion/libsvn_client/diff.c (working copy)
@@ -306,6 +306,8 @@
      unconditionally, even if the diffs are empty. */
   svn_boolean_t force_empty;
 
+ /* Output path index is relative to a directory path. */
+ const char *relative_to_dir;
 };
 
 
@@ -461,7 +463,9 @@
       /* Print out the diff header. */
       SVN_ERR(svn_stream_printf_from_utf8
               (os, diff_cmd_baton->header_encoding, subpool,
- "Index: %s" APR_EOL_STR "%s" APR_EOL_STR, path, equal_string));
+ "Index: %s" APR_EOL_STR "%s" APR_EOL_STR,
+ normalize_outputted_diff_path(path, diff_cmd_baton->relative_to_dir),
+ equal_string));
 
       SVN_ERR(svn_stream_printf_from_utf8
               (os, diff_cmd_baton->header_encoding, subpool,
@@ -511,7 +515,9 @@
       /* Print out the diff header. */
       SVN_ERR(svn_stream_printf_from_utf8
          "Index: %s" APR_EOL_STR "%s" APR_EOL_STR,
- path, equal_string));
+ normalize_outputted_diff_path(path, diff_cmd_baton->relative_to_dir),
+ equal_string));
 
           /* Output the actual diff */
- SVN_ERR(svn_diff_file_output_unified2
+ SVN_ERR(svn_diff_file_output_unified3
                   (os, diff, tmpfile1, tmpfile2, label1, label2,
- diff_cmd_baton->header_encoding, subpool));
+ diff_cmd_baton->header_encoding,
+ diff_cmd_baton->relative_to_dir, subpool));
         }
     }
 
@@ -672,7 +680,7 @@
           (diff_cmd_baton->outfile,
            diff_cmd_baton->header_encoding,
            "Index: %s (deleted)" APR_EOL_STR "%s" APR_EOL_STR,
- path, equal_string));
+ normalize_outputted_diff_path(path, diff_cmd_baton->relative_to_dir), equal_string));
 
   return SVN_NO_ERROR;
 }
@@ -1491,6 +1499,7 @@
                  apr_file_t *outfile,
                  apr_file_t *errfile,
                  svn_client_ctx_t *ctx,
+ const char *relative_to_dir,
                  apr_pool_t *pool)
 {
   struct diff_parameters diff_params;
@@ -1536,6 +1545,7 @@
   diff_cmd_baton.config = ctx->config;
   diff_cmd_baton.force_empty = FALSE;
   diff_cmd_baton.force_binary = ignore_content_type;
+ diff_cmd_baton.relative_to_dir = relative_to_dir;
 
   return do_diff(&diff_params, &diff_callbacks, &diff_cmd_baton, ctx, pool);
 }
@@ -1560,7 +1570,7 @@
                           revision2, SVN_DEPTH_INFINITY_OR_FILES(recurse),
                           ignore_ancestry, no_diff_deleted,
                           ignore_content_type, header_encoding,
- outfile, errfile, ctx, pool);
+ outfile, errfile, ctx, NULL, pool);
 }
 
 svn_error_t *
@@ -1617,6 +1627,7 @@
                      apr_file_t *outfile,
                      apr_file_t *errfile,
                      svn_client_ctx_t *ctx,
+ const char *relative_to_dir,
                      apr_pool_t *pool)
 {
   struct diff_parameters ctx,
+ NULL,
                               pool);
 }
 
Index: subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java
===================================================================
--- subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java (revision 27805)
+++ subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java (working copy)
@@ -19,7 +19,10 @@
 
 import org.tigris.subversion.javahl.*;
 
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
@@ -2450,6 +2453,34 @@
                                  "", diffOutput);
 
         diffOutput.delete();
+
+ // Test svn diff with a relative path.
+ String wcPath = fileToSVNPath(new File(thisTest.getWCPath()),
+ false);
+
+ expectedDiffOutput = "Index: iota" + NL + sepLine +
+ "--- iota\t(revision 1)" + NL +
+ "+++ iota\t(working copy)" + NL +
+ expectedDiffBody;
+ client.diff(iotaPath, Revision.BASE,
+ iotaPath, Revision.WORKING,
+ diffOutput.getPath(), Depth.infinity, true, true, false,
+ wcPath);
+ assertFileContentsEquals("Unexpected diff output in file '" +
+ diffOutput.getPath() + '\'',
+ expectedDiffOutput, diffOutput);
+
+ // Test svn diff with a relative path and trailing slash.
+ wcPath = fileToSVNPath(new File(thisTest.getWCPath() + "/"),
+ false);
+
+ client.diff(iotaPath, Revision.BASE,
+ iotaPath, Revision.WORKING,
+ diffOutput.getPath(), Depth.infinity, true, true, false,
+ wcPath);
+ assertFileContentsEquals("Unexpected diff output in file '" +
+ pp (revision 27805)
+++ subversion/bindings/javahl/native/org_tigris_subversion_javahl_SVNClient.cpp (working copy)
@@ -1106,11 +1106,11 @@
 }
 
 JNIEXPORT void JNICALL
-Java_org_tigris_subversion_javahl_SVNClient_diff__Ljava_lang_String_2Lorg_tigris_subversion_javahl_Revision_2Ljava_lang_String_2Lorg_tigris_subversion_javahl_Revision_2Ljava_lang_String_2IZZZ
+Java_org_tigris_subversion_javahl_SVNClient_diff__Ljava_lang_String_2Lorg_tigris_subversion_javahl_Revision_2Ljava_lang_String_2Lorg_tigris_subversion_javahl_Revision_2Ljava_lang_String_2IZZZLjava_lang_String_2
 (JNIEnv *env, jobject jthis, jstring jtarget1, jobject jrevision1,
  jstring jtarget2, jobject jrevision2, jstring joutfileName,
  jint jdepth, jboolean jignoreAncestry, jboolean jnoDiffDeleted,
- jboolean jforce)
+ jboolean jforce, jstring jrelativeToDir)
 {
   JNIEntry(SVNClient, diff);
   SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -1139,18 +1139,23 @@
   if (JNIUtil::isExceptionThrown())
     return;
 
+ JNIStringHolder relativeToDir(jrelativeToDir);
+ if (JNIUtil::isExceptionThrown())
+ return;
+
   cl->diff(target1, revision1, target2, revision2, outfileName,
            (svn_depth_t)jdepth,
            jignoreAncestry ? true:false,
- jnoDiffDeleted ? true:false, jforce ? true:false);
+ jnoDiffDeleted ? true:false, jforce ? true:false,
+ relativeToDir);
 }
 
 JNIEXPORT void JNICALL
-Java_org_tigris_subversion_javahl_SVNClient_diff__Ljava_lang_String_2Lorg_tigris_subversion_javahl_Revision_2Lorg_tigris_subversion_javahl_Revision_2Lorg_tigris_subversion_javahl_Revision_2Ljava_lang_String_2IZZZ
+Java_org_tigris_subversion_javahl_SVNClient_diff__Ljava_lang_String_2Lorg_tigris_subversion_javahl_Revision_2Lorg_tigris_subversion_javahl_Revision_2Lorg_tigris_subversion_javahl_Revision_2Ljava_lang_String_2IZZZLjava_lang_String_2
 (JNIEnv *env, jobject jthis, jstring jtarget, jobject jpegRevision,
  jobject jstartRevision, jobject jendRevision, jstring joutfileName,
  jint jdepth, jboolean jignoreAncestry, jboolean jnoDiffDeleted,
- jboolean eAncestry ? true:false,
- jnoDiffDeleted ? true:false, jforce ? true:false);
+ jnoDiffDeleted ? true:false, jforce ? true:false,
+ relativeToDir);
 }
 
 JNIEXPORT void JNICALL
Index: subversion/bindings/javahl/native/SVNClient.h
===================================================================
--- subversion/bindings/javahl/native/SVNClient.h (revision 27805)
+++ subversion/bindings/javahl/native/SVNClient.h (working copy)
@@ -165,11 +165,11 @@
   void diff(const char *target1, Revision &revision1,
             const char *target2, Revision &revision2,
             const char *outfileName, svn_depth_t depth, bool ignoreAncestry,
- bool noDiffDelete, bool force);
+ bool noDiffDelete, bool force, const char *relativeToDir);
   void diff(const char *target, Revision &pegevision,
             Revision &startRevision, Revision &endRevision,
             const char *outfileName, svn_depth_t depth, bool ignoreAncestry,
- bool noDiffDelete, bool force);
+ bool noDiffDelete, bool force, const char *relativeToDir);
   void diffSummarize(const char *target1, Revision &revision1,
                      const char *target2, Revision &revision2,
                      svn_depth_t depth, bool ignoreAncestry,
@@ -205,7 +205,7 @@
             const char *target2, Revision &revision2,
             Revision *pegRevision,
             const char *outfileName, svn_depth_t depth, bool ignoreAncestry,
- bool noDiffDelete, bool force);
+ bool noDiffDelete, bool force, const char *relativeToDir);
 
   jobject createJavaInfo(const svn_wc_entry_t *entry);
 
Index: subversion/bindings/javahl/native/SVNClient.cpp
===================================================================
--- subversion/bindings/javahl/native/SVNClient.cpp (revision 27805)
+++ subversion/bindings/javahl/native/SVNClient.cpp (working copy)
@@ -882,7 +882,8 @@
                      const char *target2, Revision &revision2,
                      Revision *pegRevision, const char *outfileName,
                      svn_depth_t depth, bool ignoreAncestry,
- bool noDiffDelete, bool force)
+ botfile,
                                NULL /* error file */,
                                ctx,
+ relativeToDir,
                                requestPool.pool());
     }
 
@@ -978,19 +981,21 @@
 void SVNClient::diff(const char *target1, Revision &revision1,
                      const char *target2, Revision &revision2,
                      const char *outfileName, svn_depth_t depth,
- bool ignoreAncestry, bool noDiffDelete, bool force)
+ bool ignoreAncestry, bool noDiffDelete, bool force,
+ const char *relativeToDir)
 {
     diff(target1, revision1, target2, revision2, NULL, outfileName, depth,
- ignoreAncestry, noDiffDelete, force);
+ ignoreAncestry, noDiffDelete, force, relativeToDir);
 }
 
 void SVNClient::diff(const char *target, Revision &pegRevision,
                      Revision &startRevision, Revision &endRevision,
                      const char *outfileName, svn_depth_t depth,
- bool ignoreAncestry, bool noDiffDelete, bool force)
+ bool ignoreAncestry, bool noDiffDelete, bool force,
+ const char *relativeToDir)
 {
     diff(target, startRevision, NULL, endRevision, &pegRevision, outfileName,
- depth, ignoreAncestry, noDiffDelete, force);
+ depth, ignoreAncestry, noDiffDelete, force, relativeToDir);
 }
 
 void
Index: subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientSynchronized.java
===================================================================
--- subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientSynchronized.java (revision 27805)
+++ subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientSynchronized.java (working copy)
@@ -1056,13 +1056,14 @@
     public void diff(String target1, Revision revision1, String target2,
                      Revision revision2, String outFileName, int depth,
                      boolean ignoreAncestry, boolean noDiffDeleted,
- boolean force)
+ boolean force, String relativeToDir)
             throws ClientException
     {
         synchronivision,
                      Revision startRevision, Revision endRevision,
                      String outFileName, int depth, boolean ignoreAncestry,
- boolean noDiffDeleted, boolean force)
+ boolean noDiffDeleted, boolean force,
+ String relativeToDir)
             throws ClientException
     {
         synchronized (clazz)
         {
             worker.diff(target, pegRevision, startRevision, endRevision,
                         outFileName, depth, ignoreAncestry, noDiffDeleted,
- force);
+ force, relativeToDir);
         }
     }
 
Index: subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
===================================================================
--- subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java (revision 27805)
+++ subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java (working copy)
@@ -805,7 +805,7 @@
     {
         diff(target1, revision1, target2, revision2, outFileName,
              Depth.unknownOrFiles(recurse), ignoreAncestry, noDiffDeleted,
- force);
+ force, null);
     }
 
     /**
@@ -814,7 +814,7 @@
     public native void diff(String target1, Revision revision1, String target2,
                             Revision revision2, String outFileName, int depth,
                             boolean ignoreAncestry, boolean noDiffDeleted,
- boolean force)
+ boolean force, String relativeToDir)
             throws ClientException;
 
     /**
@@ -832,7 +832,7 @@
     {
         diff(target, pegRevision, startRevision, endRevision, outFileName,
              Depth.unknownOrFiles(recurse), ignoreAncestry, noDiffDeleted,
- force);
+ force, null);
     }
 
     /**
@@ -842,7 +842,7 @@
                             Revision startRevision, Revision endRevision,
                             String outFileName, int depth,
                             boolean ignoreAncestry, boolean noDiffDeleted,
- boolean force)
+ boolean force, String relativeToDir)
             throws ClientException;
 
     /**
Index: subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java
===================================================================
--- subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java (revision 27805)
+++ subversion/bindings/javahl/src/orgs/subversion/javahl/SVNClientInterface.java (working copy)
@@ -1051,12 +1051,14 @@
      * @param ignoreAncestry ignore if files are not related
      * @param noDiffDeleted no output on deleted files
      * @param force diff even on binary files
+ * @param relativeToDir index path is relative to this path
      * @throws ClientException
      * @since 1.5
      */
     void diff(String target1, Revision revision1, String target2,
               Revision revision2, String outFileName, int depth,
- boolean ignoreAncestry, boolean noDiffDeleted, boolean force)
+ boolean ignoreAncestry, boolean noDiffDeleted, boolean force,
+ String relativeToDir)
             throws ClientException;
 
     /**
@@ -1092,12 +1094,14 @@
      * @param ignoreAncestry ignore if files are not related
      * @param noDiffDeleted no output on deleted files
      * @param force diff even on binary files
+ * @param relativeToDir index path is relative to this path
      * @throws ClientException
      * @since 1.5
      */
     void diff(String target, Revision pegRevision, Revision startRevision,
               Revision endRevision, String outFileName, int depth,
- boolean ignoreAncestry, boolean noDiffDeleted, boolean force)
+ boolean ignoreAncestry, boolean noDiffDeleted, boolean force,
+ String relativeToDir)
             throws ClientException;
 
     /**
Index: subversion/svn/diff-cmd.c
===================================================================
--- subversion/svn/diff-cmd.c (revision 27805)
+++ subversion/svn/diff-cmd.c (working copy)
@@ -367,6 +367,7 @@
                      outfile,
                      errfile,
                      ((svn_cl__cmd_baton_t *)baton)->ctx,
+ NULL,
                      iterpool));
         }
       else
@@ -410,6 +411,7 @@
                      outfile,
                      errfile,
                      ((svn_cl__cmd_baton_t *)baton)->ctx,
+ NULL,
                      iterpool));
         }
     }

This part the patch looks awfully familiar. :P

  • application/pgp-signature attachment: stored
Received on Wed Nov 14 06:21:32 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.