You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexey Dobriyan <ad...@mail.ru> on 2004/12/03 19:11:40 UTC

[PATCH] Fix issue #1722: svn diff may missreport a revision as the working copy.

Fix issue #1722: svn diff may missreport a revision as the working copy.

* subversion/libsvn_wc/diff.c: (close_file),
* subversion/libsvn_client/diff.c: (diff_repos_wc): 

If BASE < HEAD, then "diff -r BASE:HEAD" and "diff -r HEAD:BASE" should say
"(revision X)" in the second line of the diff's header, not "(working copy)".

Index: subversion/libsvn_wc/diff.c
===================================================================
--- subversion/libsvn_wc/diff.c	(revision 12127)
+++ subversion/libsvn_wc/diff.c	(working copy)
@@ -1184,7 +1184,8 @@
                   svn_wc__empty_file_path (b->wc_path, b->pool),
                   temp_file_path,
                   0, 
-                  entry ? entry->revision : SVN_INVALID_REVNUM,
+                  entry ? entry->revision :
+                          eb->use_text_base ? eb->revnum : SVN_INVALID_REVNUM,
                   NULL,
                   pristine_mimetype,
                   apr_array_make (pool, 1, sizeof (svn_prop_t)), NULL,
Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c	(revision 12127)
+++ subversion/libsvn_client/diff.c	(working copy)
@@ -2050,6 +2050,11 @@
                             url1,
                             diff_editor, diff_edit_baton, pool));
 
+  if (rev2_is_base)
+    SVN_ERR (svn_client__get_revision_number (&callback_baton->revnum2,
+                                              NULL, NULL,
+                                              revision2, path2, pool));
+
   /* Create a txn mirror of path2;  the diff editor will print
      diffs in reverse.  :-)  */
   SVN_ERR (svn_wc_crawl_revisions (path2, dir_access,


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Fix issue #1722: svn diff may missreport a revision as the working copy.

Posted by Michael W Thelen <mi...@pietdepsi.com>.
Alexey Dobriyan wrote:
> Fix issue #1722: svn diff may missreport a revision as the working copy.
> 
> * subversion/libsvn_wc/diff.c: (close_file),
> * subversion/libsvn_client/diff.c: (diff_repos_wc): 
> 
> If BASE < HEAD, then "diff -r BASE:HEAD" and "diff -r HEAD:BASE" should say
> "(revision X)" in the second line of the diff's header, not "(working copy)".

Thanks for the patch.  I've attached it to issue #1722.

-- 
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams