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/11/23 05:35:18 UTC

svn commit: r1037992 - in /subversion/trunk/subversion: libsvn_client/export.c tests/cmdline/export_tests.py

Author: danielsh
Date: Tue Nov 23 04:35:18 2010
New Revision: 1037992

URL: http://svn.apache.org/viewvc?rev=1037992&view=rev
Log:
Add notifications for file exports, and adjust one test of a pair.

* subversion/libsvn_client/export.c
  (copy_versioned_files):  Make a notification in the non-recursive case.

* subversion/tests/cmdline/export_tests.py
  (export_file_to_explicit_cwd):
    Adjust expectations.
    Rewrite to line-for-line resemble export_url_to_explicit_cwd().

Modified:
    subversion/trunk/subversion/libsvn_client/export.c
    subversion/trunk/subversion/tests/cmdline/export_tests.py

Modified: subversion/trunk/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/export.c?rev=1037992&r1=1037991&r2=1037992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/export.c (original)
+++ subversion/trunk/subversion/libsvn_client/export.c Tue Nov 23 04:35:18 2010
@@ -529,6 +529,15 @@ copy_versioned_files(const char *from,
       SVN_ERR(copy_one_versioned_file(from_abspath, to_abspath, ctx->wc_ctx,
                                       revision, native_eol, ignore_keywords,
                                       pool));
+
+      /* Notify. */
+      {
+        svn_wc_notify_t *notify = svn_wc_create_notify(to_abspath,
+                                                       svn_wc_notify_update_add,
+                                                       pool);
+        notify->kind = svn_node_file;
+        (ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      }
     }
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/export_tests.py?rev=1037992&r1=1037991&r2=1037992&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/export_tests.py Tue Nov 23 04:35:18 2010
@@ -436,6 +436,8 @@ def export_file_to_explicit_cwd(sbox):
   sbox.build(create_wc = True, read_only = True)
 
   iota_path = os.path.abspath(os.path.join(sbox.wc_dir, 'iota'))
+
+  tmpdir = sbox.get_tempname('file-exports')
   expected_output = svntest.wc.State('', {
       'iota': Item(status='A '),
       })
@@ -443,25 +445,11 @@ def export_file_to_explicit_cwd(sbox):
       'iota': Item(contents="This is the file 'iota'.\n"),
       })
 
-  # prepare some variables
-  oldcwd = os.path.abspath(os.getcwd())
-  tmpdir = sbox.get_tempname('file-exports')
   os.mkdir(tmpdir)
-
-  # do the work
   os.chdir(tmpdir)
-  svntest.actions.run_and_verify_svn(None, None, [], 
-                                     'export', iota_path, '.')
-
-  # TODO: avoid manual validation
-  try:
-    if open('iota').readlines() == ["This is the file 'iota'.\n"]:
-      return
-    else:
-      raise
-  except:
-    target_file = os.path.join(oldcwd, tmpdir, 'iota')
-    raise svntest.Failure("'%s' not properly exported" % target_file)
+  svntest.actions.run_and_verify_export(iota_path,
+                                        '.', expected_output,
+                                        expected_disk)
 
 def export_ignoring_keyword_translation(sbox):
   "export ignoring keyword translation"



Re: svn commit: r1037992 - in /subversion/trunk/subversion: libsvn_client/export.c tests/cmdline/export_tests.py

Posted by Daniel Shahaf <da...@apache.org>.
Bert Huijben wrote on Tue, Nov 23, 2010 at 11:24:45 +0100:
> > +      /* Notify. */
> > +      {
> > +        svn_wc_notify_t *notify = svn_wc_create_notify(to_abspath,
> > +
> > svn_wc_notify_update_add,
> > +                                                       pool);
> > +        notify->kind = svn_node_file;
> > +        (ctx->notify_func2)(ctx->notify_baton2, notify, pool);
> > +      }
> 
> ctx->notify_func2 can be NULL here when used from a different client than svn.

Hyrum fixed it already :-)

(Thanks!)

Daniel

RE: svn commit: r1037992 - in /subversion/trunk/subversion: libsvn_client/export.c tests/cmdline/export_tests.py

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: danielsh@apache.org [mailto:danielsh@apache.org]
> Sent: dinsdag 23 november 2010 5:35
> To: commits@subversion.apache.org
> Subject: svn commit: r1037992 - in /subversion/trunk/subversion:
> libsvn_client/export.c tests/cmdline/export_tests.py
> 
> Author: danielsh
> Date: Tue Nov 23 04:35:18 2010
> New Revision: 1037992
> 
> URL: http://svn.apache.org/viewvc?rev=1037992&view=rev
> Log:
> Add notifications for file exports, and adjust one test of a pair.
> 
> * subversion/libsvn_client/export.c
>   (copy_versioned_files):  Make a notification in the non-recursive
> case.
> 
> * subversion/tests/cmdline/export_tests.py
>   (export_file_to_explicit_cwd):
>     Adjust expectations.
>     Rewrite to line-for-line resemble export_url_to_explicit_cwd().
> 
> Modified:
>     subversion/trunk/subversion/libsvn_client/export.c
>     subversion/trunk/subversion/tests/cmdline/export_tests.py
> 
> Modified: subversion/trunk/subversion/libsvn_client/export.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/
> export.c?rev=1037992&r1=1037991&r2=1037992&view=diff
> =======================================================================
> =======
> --- subversion/trunk/subversion/libsvn_client/export.c (original)
> +++ subversion/trunk/subversion/libsvn_client/export.c Tue Nov 23
> 04:35:18 2010
> @@ -529,6 +529,15 @@ copy_versioned_files(const char *from,
>        SVN_ERR(copy_one_versioned_file(from_abspath, to_abspath, ctx-
> >wc_ctx,
>                                        revision, native_eol,
> ignore_keywords,
>                                        pool));
> +
> +      /* Notify. */
> +      {
> +        svn_wc_notify_t *notify = svn_wc_create_notify(to_abspath,
> +
> svn_wc_notify_update_add,
> +                                                       pool);
> +        notify->kind = svn_node_file;
> +        (ctx->notify_func2)(ctx->notify_baton2, notify, pool);
> +      }

ctx->notify_func2 can be NULL here when used from a different client than svn.

	Bert