Author: hwright
Date: Tue May  3 19:04:24 2011
New Revision: 1099193

URL: http://svn.apache.org/viewvc?rev=1099193&view=rev
Log:
For info, don't fake a completely bogus revision for added nodes, just
report an invalid revision.

In updating the tests, I noticed we report "Resource is not under version
control" in the XML for nodes with invalid revnums.  While this isn't
strictly true for added nodes, I'll leave that fix for future change.

* subversion/tests/cmdline/info_tests.py
  (info_on_added, info_on_mkdir): Update expectations.

* subversion/libsvn_wc/info.c
  (build_info_for_entry): Remove special case setting the revision to 0 if
    it isn't valid.

* subversion/libsvn_client/deprecated.c
  (info_from_info2): Maintain the old behavior for the deprecated struct.

Modified:
    subversion/trunk/subversion/libsvn_client/deprecated.c
    subversion/trunk/subversion/libsvn_wc/info.c
    subversion/trunk/subversion/tests/cmdline/info_tests.py

Modified: subversion/trunk/subversion/libsvn_client/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/deprecated.c?rev=1099193&r1=1099192&r2=1099193&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_client/deprecated.c Tue May  3 19:04:24 
2011
@@ -2009,7 +2009,12 @@ info_from_info2(const svn_info2_t *info2
   svn_info_t *info = apr_pcalloc(pool, sizeof(*info));
 
   info->URL                 = info2->URL;
-  info->rev                 = info2->rev;
+  /* Goofy backward compat handling for added nodes. */
+  if (SVN_IS_VALID_REVNUM(info2->rev))
+    info->rev               = info2->rev;
+  else
+    info->rev               = 0;
+
   info->kind                = info2->kind;
   info->repos_root_URL      = info2->repos_root_URL;
   info->repos_UUID          = info2->repos_UUID;

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1099193&r1=1099192&r2=1099193&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Tue May  3 19:04:24 2011
@@ -111,20 +111,11 @@ build_info_for_entry(svn_info2_t **info,
   else
     tmpinfo->rev = rev;
 
-  /* ### FIXME: For now, we'll tweak an SVN_INVALID_REVNUM and make it
-     ### 0.  In WC-1, files scheduled for addition were assigned
-     ### revision=0.  This is wrong, and we're trying to remedy that,
-     ### but for the sake of test suite and code sanity now in WC-NG,
-     ### we'll just maintain the old behavior.
-     ###
-     ### We should also just be fetching the true BASE revision
+  /* ### We should also just be fetching the true BASE revision
      ### above, which means copied items would also not have a
      ### revision to display.  But WC-1 wants to show the revision of
      ### copy targets as the copyfrom-rev.  *sigh*
   */
-  if (! SVN_IS_VALID_REVNUM(tmpinfo->rev))
-    tmpinfo->rev = 0;
-
   tmpinfo->wc_info->copyfrom_rev = SVN_INVALID_REVNUM;
 
   if (is_copy)

Modified: subversion/trunk/subversion/tests/cmdline/info_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/info_tests.py?rev=1099193&r1=1099192&r2=1099193&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/info_tests.py Tue May  3 19:04:24 
2011
@@ -227,7 +227,6 @@ def info_on_added_file(sbox):
               'Name' : 'new_file',
               'URL' : '.*/new_file',
               'Repository Root' : '.*',
-              'Revision' : '0',
               'Node Kind' : 'file',
               'Schedule' : 'add',
               'Repository UUID' : uuid_regex,
@@ -244,7 +243,7 @@ def info_on_added_file(sbox):
   verify_xml_elements(output,
                       [('entry',    {'kind'     : 'file',
                                      'path'     : new_file,
-                                     'revision' : '0'}),
+                                     'revision' : 'Resource is not under 
version control.'}),
                        ('url',      {}, '.*/new_file'),
                        ('root',     {}, '.*'),
                        ('uuid',     {}, uuid_regex),
@@ -266,7 +265,6 @@ def info_on_mkdir(sbox):
   expected = {'Path' : re.escape(new_dir),
               'URL' : '.*/new_dir',
               'Repository Root' : '.*',
-              'Revision' : '0',
               'Node Kind' : 'directory',
               'Schedule' : 'add',
               'Repository UUID' : uuid_regex,
@@ -282,7 +280,7 @@ def info_on_mkdir(sbox):
   verify_xml_elements(output,
                       [('entry',    {'kind'     : 'dir',
                                      'path'     : new_dir,
-                                     'revision' : '0'}),
+                                     'revision' : 'Resource is not under 
version control.'}),
                        ('url',      {}, '.*/new_dir'),
                        ('root',     {}, '.*'),
                        ('uuid',     {}, uuid_regex),


Reply via email to