svn commit: r1150713 - /subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 14:13:42 2011
New Revision: 1150713

URL: http://svn.apache.org/viewvc?rev=1150713view=rev
Log:
On the gpg-agent-password-store branch:

* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): Mark a couple of local variables 'const'.

Modified:

subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150713r1=1150712r2=1150713view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 (original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 Mon Jul 25 14:13:42 2011
@@ -60,7 +60,7 @@ password_get_gpg_agent(const char **pass
 {
   int sd;
   char *gpg_agent_info = NULL;
-  char *p = NULL;
+  const char *p = NULL;
   char *ep = NULL;
   char *buffer;
   
@@ -69,8 +69,8 @@ password_get_gpg_agent(const char **pass
   const char *cache_id = NULL;
   struct sockaddr_un addr;
   int recvd;
-  char *tty_name;
-  char *tty_type;
+  const char *tty_name;
+  const char *tty_type;
   const char *socket_name = NULL;
   svn_checksum_t *digest = NULL;
 




svn commit: r1150716 - /subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 14:24:53 2011
New Revision: 1150716

URL: http://svn.apache.org/viewvc?rev=1150716view=rev
Log:
On the gpg-agent-password-store branch, ensure that messages are always
read in their entirety from the agent's socket.

The GPG-Agent protocol terminates messages with newlines.
Simple calls to recv() would sometimes fail to read the terminating newline,
possibly due to concurrency issues where svn was reading from the socket
while gpg-agent was still writing. So read single bytes from the socket
and watch out for a terminating newline.

* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (receive_from_gpg_agent): New helper function. Attempts to read a
   complete newline-terminated message from the agent's socket.
   Also makes sure the result is NUL-terminated so caller's don't have to.
  (password_get_gpg_agent): Use receive_from_gpg_agent() instead of recv().

Modified:

subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150716r1=1150715r2=1150716view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 (original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 Mon Jul 25 14:24:53 2011
@@ -47,6 +47,37 @@
 
 #define BUFFER_SIZE 1024
 
+/* Attempt to read a gpg-agent response message from the socket SD into
+ * buffer BUF. Buf is assumed to be N bytes large. Return TRUE if a response
+ * message could be read that fits into the buffer. Else return FALSE.
+ * If a message could be read it will always be NUL-terminated and the
+ * trailing newline is retained. */
+static svn_boolean_t
+receive_from_gpg_agent(int sd, char *buf, size_t n)
+{
+  int i = 0;
+  int recvd;
+  char c;
+
+  /* Require the message to fit into the buffer and be terminated
+   * with a newline. */
+  while (i  n)
+{
+  recvd = read(sd, c, 1);
+  if (recvd == -1)
+return FALSE;
+  buf[i] = c;
+  i++;
+  if (i  n  c == '\n')
+{
+  buf[i] = '\0';
+  return TRUE;
+}
+}
+
+return FALSE;
+}
+
 /* Implementation of svn_auth__password_get_t that retrieves the password
from gpg-agent */
 static svn_boolean_t
@@ -68,7 +99,6 @@ password_get_gpg_agent(const char **pass
   char *request = NULL;
   const char *cache_id = NULL;
   struct sockaddr_un addr;
-  int recvd;
   const char *tty_name;
   const char *tty_type;
   const char *socket_name = NULL;
@@ -105,8 +135,11 @@ password_get_gpg_agent(const char **pass
 
   /* Receive the connection status from the gpg-agent daemon. */
   buffer = apr_palloc(pool, BUFFER_SIZE);
-  recvd = recv(sd, buffer, BUFFER_SIZE - 1, 0);
-  buffer[recvd] = '\0';
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
+{
+  close(sd);
+  return FALSE;
+}
 
   if (strncmp(buffer, OK, 2) != 0)
 return FALSE;
@@ -117,8 +150,11 @@ password_get_gpg_agent(const char **pass
 {
   request = apr_psprintf(pool, OPTION ttyname=%s\n, tty_name);
   send(sd, request, strlen(request), 0);
-  recvd = recv(sd, buffer, BUFFER_SIZE - 1, 0);
-  buffer[recvd] = '\0';
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
+{
+  close(sd);
+  return FALSE;
+}
 
   if (strncmp(buffer, OK, 2) != 0)
 return FALSE;
@@ -132,8 +168,11 @@ password_get_gpg_agent(const char **pass
 {
   request = apr_psprintf(pool, OPTION ttytype=%s\n, tty_type);
   send(sd, request, strlen(request), 0);
-  recvd = recv(sd, buffer, BUFFER_SIZE - 1, 0);
-  buffer[recvd] = '\0';
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
+{
+  close(sd);
+  return FALSE;
+}
 
   if (strncmp(buffer, OK, 2) != 0)
 return FALSE;
@@ -158,8 +197,11 @@ password_get_gpg_agent(const char **pass
cache_id);
 
   send(sd, request, strlen(request) + 1, 0);
-  recvd = recv(sd, buffer, BUFFER_SIZE - 1, 0);
-  buffer[recvd] = '\0';
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
+{
+  close(sd);
+  return FALSE;
+}
 
   if (strncmp(buffer, ERR, 3) == 0)
 return FALSE;




svn commit: r1150720 - /subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 14:28:55 2011
New Revision: 1150720

URL: http://svn.apache.org/viewvc?rev=1150720view=rev
Log:
On the gpg-agent-password-store branch, ensure that the gpg-agent socket
is always closed.

* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): Close the socket SD in all error paths.

Modified:

subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150720r1=1150719r2=1150720view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 (original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 Mon Jul 25 14:28:55 2011
@@ -142,7 +142,10 @@ password_get_gpg_agent(const char **pass
 }
 
   if (strncmp(buffer, OK, 2) != 0)
-return FALSE;
+{
+  close(sd);
+  return FALSE;
+}
 
   /* Send TTY_NAME to the gpg-agent daemon. */
   tty_name = getenv(GPG_TTY);
@@ -157,10 +160,16 @@ password_get_gpg_agent(const char **pass
 }
 
   if (strncmp(buffer, OK, 2) != 0)
-return FALSE;
+{
+  close(sd);
+  return FALSE;
+}
 }
   else
-return FALSE;
+{
+  close(sd);
+  return FALSE;
+}
 
   /* Send TTY_TYPE to the gpg-agent daemon. */
   tty_type = getenv(TERM);
@@ -175,10 +184,16 @@ password_get_gpg_agent(const char **pass
 }
 
   if (strncmp(buffer, OK, 2) != 0)
-return FALSE;
+{
+  close(sd);
+  return FALSE;
+}
 }
   else
-return FALSE;
+{
+  close(sd);
+  return FALSE;
+}
 
   /* Create the CACHE_ID which will be generated based on REALMSTRING similar
  to other password caching mechanisms. */
@@ -203,6 +218,8 @@ password_get_gpg_agent(const char **pass
   return FALSE;
 }
 
+  close(sd);
+
   if (strncmp(buffer, ERR, 3) == 0)
 return FALSE;
   
@@ -215,7 +232,6 @@ password_get_gpg_agent(const char **pass
 
   *password = p;
 
-  close(sd);
   return TRUE;
 }
 




svn commit: r1150723 - /subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 14:33:32 2011
New Revision: 1150723

URL: http://svn.apache.org/viewvc?rev=1150723view=rev
Log:
On the gpg-agent-password-store branch, send the values of the LC_CTYPE
and DISPLAY variables to gpg-agent. These might be useful for the pinentry
program.

* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): If LC_CTYPE and/or DISPLAY environment variables
   are set, use their values as arguments for the --lc-ctype and --display
   options of gpg-agent.

Modified:

subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150723r1=1150722r2=1150723view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 (original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 Mon Jul 25 14:33:32 2011
@@ -101,6 +101,8 @@ password_get_gpg_agent(const char **pass
   struct sockaddr_un addr;
   const char *tty_name;
   const char *tty_type;
+  const char *lc_ctype;
+  const char *display;
   const char *socket_name = NULL;
   svn_checksum_t *digest = NULL;
 
@@ -195,6 +197,46 @@ password_get_gpg_agent(const char **pass
   return FALSE;
 }
 
+  /* Send LC_CTYPE to the gpg-agent daemon. */
+  lc_ctype = getenv(LC_CTYPE);
+  if (lc_ctype == NULL)
+lc_ctype = getenv(LC_ALL);
+  if (lc_ctype == NULL)
+lc_ctype = getenv(LANG);
+  if (lc_ctype != NULL)
+{
+  request = apr_psprintf(pool, OPTION lc-ctype=%s\n, lc_ctype);
+  send(sd, request, strlen(request), 0);
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
+{
+  close(sd);
+  return FALSE;
+}
+  if (strncmp(buffer, OK, 2) != 0)
+{
+  close(sd);
+  return FALSE;
+}
+}
+
+  /* Send DISPLAY to the gpg-agent daemon. */
+  display = getenv(DISPLAY);
+  if (display != NULL)
+{
+  request = apr_psprintf(pool, OPTION display=%s\n, display);
+  send(sd, request, strlen(request), 0);
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
+{
+  close(sd);
+  return FALSE;
+}
+  if (strncmp(buffer, OK, 2) != 0)
+{
+  close(sd);
+  return FALSE;
+}
+}
+
   /* Create the CACHE_ID which will be generated based on REALMSTRING similar
  to other password caching mechanisms. */
   digest = svn_checksum_create(svn_checksum_md5, pool);




svn commit: r1150728 - /subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 14:45:59 2011
New Revision: 1150728

URL: http://svn.apache.org/viewvc?rev=1150728view=rev
Log:
On the gpg-agent-password-store branch, improve the pinentry program's prompt.

Put the name of the authentication realm into the prompt.
Change the password prompt to match the prompt of the standard
command line client and allow it to be internationalised.

Also make the pinentry program ask for the password twice.
It is not easy for users to get rid of an invalid password once it is
in the agent's cache (the easiest way is probably to kill the agent).
Asking for the password twice makes such mistakes less likely.

* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (escape_blanks): New helper functions to escape blanks in GPG-Agent
   protocol messages.
  (password_get_gpg_agent): Pass the auth realm as description to the
   GET_PASSPHRASE command. Use a better password prompt that matches
   the 'svn' client prompt. Pass the --repeat=1 option to GET_PASSPHRASE.
   Escape all arguments that might contain blanks with escape_blanks().

Modified:

subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150728r1=1150727r2=1150728view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 (original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 Mon Jul 25 14:45:59 2011
@@ -47,6 +47,23 @@
 
 #define BUFFER_SIZE 1024
 
+/* Modify STR in-place such that blanks are escaped as required by the
+ * gpg-agent protocol. Return a pointer to STR. */
+static char *
+escape_blanks(char *str)
+{
+  char *s = str;
+
+  while (*s)
+{
+  if (*s == ' ')
+*s = '+';
+  s++;
+}
+
+  return str;
+}
+
 /* Attempt to read a gpg-agent response message from the socket SD into
  * buffer BUF. Buf is assumed to be N bytes large. Return TRUE if a response
  * message could be read that fits into the buffer. Else return FALSE.
@@ -105,6 +122,8 @@ password_get_gpg_agent(const char **pass
   const char *display;
   const char *socket_name = NULL;
   svn_checksum_t *digest = NULL;
+  char *password_prompt;
+  char *realm_prompt;
 
   gpg_agent_info = getenv(GPG_AGENT_INFO);
   if (gpg_agent_info != NULL)
@@ -244,14 +263,21 @@ password_get_gpg_agent(const char **pass
pool);
   cache_id = svn_checksum_to_cstring(digest, pool);
 
-  if (non_interactive)
-request = apr_psprintf(pool,
-   GET_PASSPHRASE --data --no-ask %s X Password: \n,
-   cache_id);
-  else
-request = apr_psprintf(pool,
-   GET_PASSPHRASE --data %s X Password: \n,
-   cache_id);
+  /* A newline is required to terminate the GET_PASSPHRASE command.
+   * We append it to REALM_PROMPT because it is the last argument of
+   * the format string below, and because both of the prompt strings
+   * already exist elsewhere in this exact form so they will only
+   * have to be translated once for i18n. */
+  password_prompt = apr_psprintf(pool, _(Password for '%s': ), username);
+  realm_prompt = apr_psprintf(pool, _(Authentication realm: %s\n),
+  realmstring);
+  request = apr_psprintf(pool,
+ GET_PASSPHRASE --data %s--repeat=1 
+ %s X %s %s,
+ non_interactive ? --no-ask  : ,
+ cache_id,
+ escape_blanks(password_prompt),
+ escape_blanks(realm_prompt));
 
   send(sd, request, strlen(request) + 1, 0);
   if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))




svn commit: r1150729 - /subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 14:47:34 2011
New Revision: 1150729

URL: http://svn.apache.org/viewvc?rev=1150729view=rev
Log:
On the gpg-agent-password-store branch, avoid a potential NULL-derefernce.

* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): Do not crash if the agent returns an empty
   string as password.

Modified:

subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150729r1=1150728r2=1150729view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 (original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
 Mon Jul 25 14:47:34 2011
@@ -294,6 +294,9 @@ password_get_gpg_agent(const char **pass
   if (strncmp(buffer, D, 1) == 0)
 p = buffer[2];
 
+  if (!p)
+return FALSE;
+
   ep = strchr(p, '\n');
   if (ep != NULL)
 *ep = '\0';




svn commit: r1150751 [3/5] - in /subversion/branches/gpg-agent-password-store: ./ build/ac-macros/ build/generator/swig/ notes/ subversion/bindings/swig/perl/native/t/ subversion/include/ subversion/i

2011-07-25 Thread stsp
Modified: 
subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/adm_crawler.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/adm_crawler.c?rev=1150751r1=1150750r2=1150751view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/adm_crawler.c 
(original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/adm_crawler.c 
Mon Jul 25 15:34:28 2011
@@ -1112,21 +1112,12 @@ svn_wc__internal_transmit_text_deltas(co
 NULL, NULL,
 scratch_pool, scratch_pool);
 
-  /* Close the two streams to force writing the digest,
- if we already have an error, ignore this one. */
-  if (err)
-{
-  svn_error_clear(svn_stream_close(base_stream));
-  svn_error_clear(svn_stream_close(local_stream));
-}
-  else
-{
-  SVN_ERR(svn_stream_close(base_stream));
-  SVN_ERR(svn_stream_close(local_stream));
-}
+  /* Close the two streams to force writing the digest */
+  err = svn_error_compose_create(err, svn_stream_close(base_stream));
+  err = svn_error_compose_create(err, svn_stream_close(local_stream));
 
-  /* If we have an error, it may be caused by a corrupt text base.
- Check the checksum and discard `err' if they don't match. */
+  /* If we have an error, it may be caused by a corrupt text base,
+ so check the checksum. */
   if (expected_md5_checksum  verify_checksum
!svn_checksum_match(expected_md5_checksum, verify_checksum))
 {
@@ -1142,19 +1133,20 @@ svn_wc__internal_transmit_text_deltas(co
  investigate.  Other commands could be affected,
  too, such as `svn diff'.  */
 
-  /* Deliberately ignore errors; the error about the
- checksum mismatch is more important to return. */
-  svn_error_clear(err);
   if (tempfile)
-svn_error_clear(svn_io_remove_file2(*tempfile, TRUE, scratch_pool));
+err = svn_error_compose_create(
+  err,
+  svn_io_remove_file2(*tempfile, TRUE, scratch_pool));
 
-  return svn_error_create(SVN_ERR_WC_CORRUPT_TEXT_BASE,
-svn_checksum_mismatch_err(expected_md5_checksum, verify_checksum,
+  err = svn_error_compose_create(
+  svn_checksum_mismatch_err(expected_md5_checksum, verify_checksum,
 scratch_pool,
 _(Checksum mismatch for text base of '%s'),
 svn_dirent_local_style(local_abspath,
scratch_pool)),
-NULL);
+  err);
+
+  return svn_error_create(SVN_ERR_WC_CORRUPT_TEXT_BASE, err, NULL);
 }
 
   /* Now, handle that delta transmission error if any, so we can stop

Modified: 
subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/conflicts.c?rev=1150751r1=1150750r2=1150751view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/conflicts.c 
(original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/conflicts.c 
Mon Jul 25 15:34:28 2011
@@ -215,7 +215,6 @@ resolve_conflict_on_node(svn_wc__db_t *d
 
   if (resolve_text)
 {
-  svn_stream_t *tmp_stream = NULL;
   const char *auto_resolve_src;
 
   /* Handle automatic conflict resolution before the temporary files are
@@ -240,6 +239,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
 if (conflict_old  conflict_working  conflict_new)
   {
 const char *temp_dir;
+svn_stream_t *tmp_stream = NULL;
 svn_diff_t *diff;
 svn_diff_conflict_display_style_t style =
   conflict_choice == svn_wc_conflict_choose_theirs_conflict
@@ -252,7 +252,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
 SVN_ERR(svn_stream_open_unique(tmp_stream,
auto_resolve_src,
temp_dir,
-   svn_io_file_del_on_close,
+   svn_io_file_del_on_pool_cleanup,
pool, pool));
 
 SVN_ERR(svn_diff_file_diff3_2(diff,
@@ -269,6 +269,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
 NULL, NULL, NULL, NULL,
 style,
 pool));
+SVN_ERR(svn_stream_close(tmp_stream));
   }
 else
   auto_resolve_src = NULL;
@@ -283,9 +284,6 @@ 

svn commit: r1150751 [5/5] - in /subversion/branches/gpg-agent-password-store: ./ build/ac-macros/ build/generator/swig/ notes/ subversion/bindings/swig/perl/native/t/ subversion/include/ subversion/i

2011-07-25 Thread stsp
Modified: 
subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_client/client-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_client/client-test.c?rev=1150751r1=1150750r2=1150751view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_client/client-test.c
 (original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_client/client-test.c
 Mon Jul 25 15:34:28 2011
@@ -244,6 +244,7 @@ check_patch_result(const char *path, con
   svn_pool_destroy(iterpool);
 
   SVN_TEST_ASSERT(i == num_expected_lines);
+  SVN_ERR(svn_stream_close(stream));
   SVN_ERR(svn_io_remove_file2(path, FALSE, pool));
 
   return SVN_NO_ERROR;

Modified: 
subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_diff/parse-diff-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_diff/parse-diff-test.c?rev=1150751r1=1150750r2=1150751view=diff
==
--- 
subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_diff/parse-diff-test.c
 (original)
+++ 
subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_diff/parse-diff-test.c
 Mon Jul 25 15:34:28 2011
@@ -247,28 +247,28 @@ static const char *bad_git_diff_header =
   new file mode 100644NL;
 
 
-/* Create a PATCH_FILE with name FNAME containing the contents of DIFF. */
+/* Create a PATCH_FILE containing the contents of DIFF. */
 static svn_error_t *
-create_patch_file(svn_patch_file_t **patch_file, const char *fname,
+create_patch_file(svn_patch_file_t **patch_file,
   const char *diff, apr_pool_t *pool)
 {
+  apr_size_t bytes;
   apr_size_t len;
-  apr_status_t status;
+  const char *path;
   apr_file_t *apr_file;
 
   /* Create a patch file. */
-  status = apr_file_open(apr_file, fname,
-(APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE |
- APR_DELONCLOSE), APR_OS_DEFAULT, pool);
-  if (status != APR_SUCCESS)
-return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, Cannot open '%s',
- fname);
-  len = strlen(diff);
-  status = apr_file_write_full(apr_file, diff, len, len);
-  if (status || len != strlen(diff))
+  SVN_ERR(svn_io_open_unique_file3(apr_file, path, NULL,
+   svn_io_file_del_on_pool_cleanup,
+   pool, pool));
+
+  bytes = strlen(diff);
+  SVN_ERR(svn_io_file_write_full(apr_file, diff, bytes, len, pool));
+  if (len != bytes)
 return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
- Cannot write to '%s', fname);
-  SVN_ERR(svn_diff_open_patch_file(patch_file, fname, pool));
+ Cannot write to '%s', path);
+  SVN_ERR(svn_io_file_close(apr_file, pool));
+  SVN_ERR(svn_diff_open_patch_file(patch_file, path, pool));
 
   return SVN_NO_ERROR;
 }
@@ -314,7 +314,6 @@ static svn_error_t *
 test_parse_unidiff(apr_pool_t *pool)
 {
   svn_patch_file_t *patch_file;
-  const char *fname = test_parse_unidiff.patch;
   svn_boolean_t reverse;
   svn_boolean_t ignore_whitespace;
   int i;
@@ -330,7 +329,7 @@ test_parse_unidiff(apr_pool_t *pool)
 
   svn_pool_clear(iterpool);
 
-  SVN_ERR(create_patch_file(patch_file, fname, unidiff, pool));
+  SVN_ERR(create_patch_file(patch_file, unidiff, pool));
 
   /* We have two patches with one hunk each.
* Parse the first patch. */
@@ -393,9 +392,8 @@ test_parse_git_diff(apr_pool_t *pool)
   svn_patch_file_t *patch_file;
   svn_patch_t *patch;
   svn_diff_hunk_t *hunk;
-  const char *fname = test_parse_git_diff.patch;
 
-  SVN_ERR(create_patch_file(patch_file, fname, git_unidiff, pool));
+  SVN_ERR(create_patch_file(patch_file, git_unidiff, pool));
 
   /* Parse a deleted empty file */
   SVN_ERR(svn_diff_parse_next_patch(patch, patch_file,
@@ -467,10 +465,8 @@ test_parse_git_tree_and_text_diff(apr_po
   svn_patch_file_t *patch_file;
   svn_patch_t *patch;
   svn_diff_hunk_t *hunk;
-  const char *fname = test_parse_git_tree_and_text_diff.patch;
 
-  SVN_ERR(create_patch_file(patch_file, fname, git_tree_and_text_unidiff,
-pool));
+  SVN_ERR(create_patch_file(patch_file, git_tree_and_text_unidiff, pool));
 
   /* Parse a copied file with text modifications. */
   SVN_ERR(svn_diff_parse_next_patch(patch, patch_file,
@@ -567,10 +563,8 @@ test_bad_git_diff_headers(apr_pool_t *po
   svn_patch_file_t *patch_file;
   svn_patch_t *patch;
   svn_diff_hunk_t *hunk;
-  const char *fname = test_bad_git_diff_header.patch;
 
-  SVN_ERR(create_patch_file(patch_file, fname, bad_git_diff_header,
-pool));
+  SVN_ERR(create_patch_file(patch_file, bad_git_diff_header, 

svn commit: r1150760 - /subversion/branches/gpg-agent-password-store/notes/moves

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 15:54:54 2011
New Revision: 1150760

URL: http://svn.apache.org/viewvc?rev=1150760view=rev
Log:
On the gpg-agent-password-store branch, remerge (that is, reverse-merge
and then merge again) r1146165, r1146496, r1146501. For some reason the
right set of changes was not merge into this branch when these revisions
were originally merged.

Added:
subversion/branches/gpg-agent-password-store/notes/moves
  - copied, changed from r1146165, subversion/trunk/notes/moves

Copied: subversion/branches/gpg-agent-password-store/notes/moves (from 
r1146165, subversion/trunk/notes/moves)
URL: 
http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/notes/moves?p2=subversion/branches/gpg-agent-password-store/notes/movesp1=subversion/trunk/notes/movesr1=1146165r2=1150760rev=1150760view=diff
==
--- subversion/trunk/notes/moves (original)
+++ subversion/branches/gpg-agent-password-store/notes/moves Mon Jul 25 
15:54:54 2011
@@ -66,6 +66,11 @@ Some existing interfaces will be extende
 and _scan_deletion() interfaces will be extended to differentiate
 moved nodes from copied, added, and deleted nodes.
 
+### gstein: note that scan_addition() already returns status_moved_here,
+###   and scan_deletion() returns a MOVED_TO_ABSPATH. these functions
+###   should already do what you're asking (with bitrot and untested
+###   caveats since I first implemented them).
+
 There might be some public API changes (TBD).
 
 We might require a working copy upgrade when going from 1.7 to 1.8,
@@ -101,6 +106,11 @@ Some code that is expected to change beh
  - update/merge: Update and Merge will use move information to auto-resolve
 the local move vs. incoming edit tree conflict scenario.
 
+ - diff: Diff will use move information to generate 'rename from' headers
+when the --git option is used.
+
+ - patch: Patch will use move information to apply changes to files
+which have been moved locally.
 
 Several public APIs may be bumped as their behaviour changes.
 For backwards compatibility, APIs released prior to 1.8 will continue




svn commit: r1150762 - /subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnmucc_tests.py

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 15:58:20 2011
New Revision: 1150762

URL: http://svn.apache.org/viewvc?rev=1150762view=rev
Log:
For some reason, when r1144381 was merged into the gpg-agent-password-store
branch, the file subversion/tests/cmdline/svnmucc_tests.py didn't get added.
So do this now.

Added:

subversion/branches/gpg-agent-password-store/subversion/tests/cmdline/svnmucc_tests.py
  - copied unchanged from r1144381, 
subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py



svn commit: r1150783 - in /subversion/trunk: ./ subversion/include/ subversion/include/private/ subversion/libsvn_auth_gpg_agent/ subversion/libsvn_subr/

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 17:14:15 2011
New Revision: 1150783

URL: http://svn.apache.org/viewvc?rev=1150783view=rev
Log:
Reintegrate the gpg-agent-password-store branch.
It is now working quite well. Further cleanup can happen on trunk.

The merge was an interesting experience. In addition to the problems
fixed by r1150760 and r1150762, I ended up with 3 unrelated content
and 8 unrelated svn:mergeinfo changes on the following files:

   M  subversion/include/private/svn_temp_serializer.h
   M  subversion/include/private/svn_string_private.h
   M  subversion/include/private/svn_adler32.h
   M  subversion/libsvn_fs_fs/temp_serializer.c
   M  subversion/libsvn_fs_fs/temp_serializer.h
   M  subversion/libsvn_subr/hash.c
   M  subversion/libsvn_subr/svn_temp_serializer.c
   M  subversion/libsvn_subr/adler32.c
  D   tools/dist/templates/stable-release-ann.ezt
  D   tools/dist/templates/rc-release-ann.ezt
  M   notes/ra-serf-testing.txt

All these changes were reverted before commit. I suppose they were due
to faulty sync merges from trunk, probably done by myself.
But I don't really know what happened here...

Added:
subversion/trunk/subversion/libsvn_auth_gpg_agent/
  - copied from r1150766, 
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/
Modified:
subversion/trunk/   (props changed)
subversion/trunk/Makefile.in
subversion/trunk/build.conf
subversion/trunk/configure.ac
subversion/trunk/subversion/include/private/svn_auth_private.h
subversion/trunk/subversion/include/svn_auth.h
subversion/trunk/subversion/libsvn_subr/auth.c
subversion/trunk/subversion/libsvn_subr/config_file.c
subversion/trunk/subversion/libsvn_subr/simple_providers.c

Propchange: subversion/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jul 25 17:14:15 2011
@@ -11,6 +11,7 @@
 /subversion/branches/fs-rep-sharing:869036-873803
 /subversion/branches/fsfs-pack:873717-874575
 /subversion/branches/gnome-keyring:870558-871410
+/subversion/branches/gpg-agent-password-store:1005036-1150766
 /subversion/branches/http-protocol-v2:874395-876041
 /subversion/branches/in-memory-cache:869829-871452
 /subversion/branches/integrate-cache-item-serialization:1068724-1068739

Modified: subversion/trunk/Makefile.in
URL: 
http://svn.apache.org/viewvc/subversion/trunk/Makefile.in?rev=1150783r1=1150782r2=1150783view=diff
==
--- subversion/trunk/Makefile.in (original)
+++ subversion/trunk/Makefile.in Mon Jul 25 17:14:15 2011
@@ -47,6 +47,7 @@ SVN_APR_LIBS = @SVN_APR_LIBS@
 SVN_APRUTIL_LIBS = @SVN_APRUTIL_LIBS@
 SVN_APR_MEMCACHE_LIBS = @SVN_APR_MEMCACHE_LIBS@
 SVN_DB_LIBS = @SVN_DB_LIBS@
+SVN_GPG_AGENT_LIBS = @SVN_GPG_AGENT_LIBS@
 SVN_GNOME_KEYRING_LIBS = @SVN_GNOME_KEYRING_LIBS@
 SVN_GSSAPI_LIBS = @SVN_GSSAPI_LIBS@
 SVN_KWALLET_LIBS = @SVN_KWALLET_LIBS@
@@ -66,6 +67,7 @@ fsmod_libdir = @libdir@
 ramod_libdir = @libdir@
 bdb_libdir = @libdir@
 gnome_keyring_libdir = @libdir@
+gpg_agent_libdir = @libdir@
 gssapi_libdir = @libdir@
 kwallet_libdir = @libdir@
 neon_libdir = @libdir@
@@ -235,6 +237,7 @@ INSTALL_FSMOD_LIB = $(INSTALL_LIB)
 INSTALL_RAMOD_LIB = $(INSTALL_LIB)
 INSTALL_APR_MEMCACHE_LIB = $(INSTALL_LIB)
 INSTALL_BDB_LIB = $(INSTALL_LIB)
+INSTALL_GPG_AGENT_LIB = $(INSTALL_LIB)
 INSTALL_GNOME_KEYRING_LIB = $(INSTALL_LIB)
 INSTALL_GSSAPI_LIB = $(INSTALL_LIB)
 INSTALL_KWALLET_LIB = $(INSTALL_LIB)

Modified: subversion/trunk/build.conf
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1150783r1=1150782r2=1150783view=diff
==
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Mon Jul 25 17:14:15 2011
@@ -174,6 +174,14 @@ libs = libsvn_client libsvn_ra libsvn_re
 install = bin
 manpages = subversion/svnrdump/svnrdump.1
 
+# Support for GPG Agent
+[libsvn_auth_gpg_agent]]
+description = Subversion GPG Agent library
+type = lib
+install = gpg-agent-lib
+path = subversion/libsvn_auth_gpg_agent
+libs = apr libsvn_subr
+
 # Support for GNOME Keyring
 [libsvn_auth_gnome_keyring]
 description = Subversion GNOME Keyring Library

Modified: subversion/trunk/configure.ac
URL: 
http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1150783r1=1150782r2=1150783view=diff
==
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Mon Jul 25 17:14:15 2011
@@ -567,6 +567,25 @@ int main()
   fi
 fi
 
+dnl GPG Agent ---
+
+AC_ARG_WITH(gpg_agent,
+AS_HELP_STRING([--without-gpg-agent], 
+   [Disable support for GPG-Agent]),
+   [with_gpg_agent=no], [with_gpg_agent=yes])
+AC_MSG_CHECKING([whether

svn commit: r1150789 - /subversion/trunk/subversion/include/svn_auth.h

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 17:18:33 2011
New Revision: 1150789

URL: http://svn.apache.org/viewvc?rev=1150789view=rev
Log:
* subversion/include/svn_auth.h
  (svn_auth_gpg_agent_version): Add @since tag.
  (svn_auth_get_gpg_agent_simple_provider): Fix @since tag.

Modified:
subversion/trunk/subversion/include/svn_auth.h

Modified: subversion/trunk/subversion/include/svn_auth.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_auth.h?rev=1150789r1=1150788r2=1150789view=diff
==
--- subversion/trunk/subversion/include/svn_auth.h (original)
+++ subversion/trunk/subversion/include/svn_auth.h Mon Jul 25 17:18:33 2011
@@ -1074,6 +1074,7 @@ svn_auth_get_kwallet_ssl_client_cert_pw_
 /**
  * Get libsvn_auth_gpg_agent version information.
  *
+ * @since New in 1.8.
  */
 const svn_version_t *
 svn_auth_gpg_agent_version(void);
@@ -1090,7 +1091,7 @@ svn_auth_gpg_agent_version(void);
  *
  * Allocate @a *provider in @a pool.
  *
- * @since New in 1.7
+ * @since New in 1.8
  * @note This function actually works only on systems with
  * libsvn_auth_gpg_agent and GNU Privacy Guard installed.
  */




svn commit: r1150801 - /subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 17:43:18 2011
New Revision: 1150801

URL: http://svn.apache.org/viewvc?rev=1150801view=rev
Log:
Some refactoring in the gpg-agent code. No functional change.

* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (send_option): New helper function that sends an option to the gpg-agent.
  (password_get_gpg_agent): Use the new helper function, thereby
   getting rid of some needless code repetition.

Modified:
subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150801r1=1150800r2=1150801view=diff
==
--- subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 
17:43:18 2011
@@ -95,6 +95,29 @@ receive_from_gpg_agent(int sd, char *buf
 return FALSE;
 }
 
+/* Using socket SD, send the option OPTION with the specified VALUE
+ * to the gpg agent. Store the response in BUF, assumed to be N bytes
+ * in size, and evaluate the response. Return TRUE if the agent liked
+ * the smell of the option, if there is such a thing, and doesn't feel
+ * saturated by it. Else return FALSE.
+ * Do temporary allocations in scratch_pool. */
+static svn_boolean_t
+send_option(int sd, char *buf, size_t n, const char *option, const char *value,
+apr_pool_t *scratch_pool)
+{
+  const char *request;
+
+  request = apr_psprintf(scratch_pool, OPTION %s=%s\n, option, value);
+
+  if (send(sd, request, strlen(request), 0) == -1)
+return FALSE;
+
+  if (!receive_from_gpg_agent(sd, buf, n))
+return FALSE;
+
+  return (strncmp(buf, OK, 2) == 0);
+}
+
 /* Implementation of svn_auth__password_get_t that retrieves the password
from gpg-agent */
 static svn_boolean_t
@@ -172,15 +195,7 @@ password_get_gpg_agent(const char **pass
   tty_name = getenv(GPG_TTY);
   if (tty_name != NULL)
 {
-  request = apr_psprintf(pool, OPTION ttyname=%s\n, tty_name);
-  send(sd, request, strlen(request), 0);
-  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
-{
-  close(sd);
-  return FALSE;
-}
-
-  if (strncmp(buffer, OK, 2) != 0)
+  if (!send_option(sd, buffer, BUFFER_SIZE - 1, ttyname, tty_name, pool))
 {
   close(sd);
   return FALSE;
@@ -196,15 +211,7 @@ password_get_gpg_agent(const char **pass
   tty_type = getenv(TERM);
   if (tty_type != NULL)
 {
-  request = apr_psprintf(pool, OPTION ttytype=%s\n, tty_type);
-  send(sd, request, strlen(request), 0);
-  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
-{
-  close(sd);
-  return FALSE;
-}
-
-  if (strncmp(buffer, OK, 2) != 0)
+  if (!send_option(sd, buffer, BUFFER_SIZE - 1, ttytype, tty_type, pool))
 {
   close(sd);
   return FALSE;
@@ -224,14 +231,7 @@ password_get_gpg_agent(const char **pass
 lc_ctype = getenv(LANG);
   if (lc_ctype != NULL)
 {
-  request = apr_psprintf(pool, OPTION lc-ctype=%s\n, lc_ctype);
-  send(sd, request, strlen(request), 0);
-  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
-{
-  close(sd);
-  return FALSE;
-}
-  if (strncmp(buffer, OK, 2) != 0)
+  if (!send_option(sd, buffer, BUFFER_SIZE - 1, lc-ctype, lc_ctype, 
pool))
 {
   close(sd);
   return FALSE;
@@ -243,13 +243,7 @@ password_get_gpg_agent(const char **pass
   if (display != NULL)
 {
   request = apr_psprintf(pool, OPTION display=%s\n, display);
-  send(sd, request, strlen(request), 0);
-  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
-{
-  close(sd);
-  return FALSE;
-}
-  if (strncmp(buffer, OK, 2) != 0)
+  if (!send_option(sd, buffer, BUFFER_SIZE - 1, display, display, pool))
 {
   close(sd);
   return FALSE;




svn commit: r1150803 - /subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 17:45:07 2011
New Revision: 1150803

URL: http://svn.apache.org/viewvc?rev=1150803view=rev
Log:
* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): Do not ignore errors thrown by the send() function.

Modified:
subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150803r1=1150802r2=1150803view=diff
==
--- subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 
17:45:07 2011
@@ -273,7 +273,11 @@ password_get_gpg_agent(const char **pass
  escape_blanks(password_prompt),
  escape_blanks(realm_prompt));
 
-  send(sd, request, strlen(request) + 1, 0);
+  if (send(sd, request, strlen(request) + 1, 0) == -1)
+{
+  close(sd);
+  return FALSE;
+}
   if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
 {
   close(sd);




svn commit: r1150807 - /subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 17:48:52 2011
New Revision: 1150807

URL: http://svn.apache.org/viewvc?rev=1150807view=rev
Log:
* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (send_option, password_get_gpg_agent): Use write() instead of send().
   We don't set any flags for send() so we might as well just use write().

Modified:
subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150807r1=1150806r2=1150807view=diff
==
--- subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 
17:48:52 2011
@@ -109,7 +109,7 @@ send_option(int sd, char *buf, size_t n,
 
   request = apr_psprintf(scratch_pool, OPTION %s=%s\n, option, value);
 
-  if (send(sd, request, strlen(request), 0) == -1)
+  if (write(sd, request, strlen(request)) == -1)
 return FALSE;
 
   if (!receive_from_gpg_agent(sd, buf, n))
@@ -273,7 +273,7 @@ password_get_gpg_agent(const char **pass
  escape_blanks(password_prompt),
  escape_blanks(realm_prompt));
 
-  if (send(sd, request, strlen(request) + 1, 0) == -1)
+  if (write(sd, request, strlen(request) + 1) == -1)
 {
   close(sd);
   return FALSE;




svn commit: r1150833 - in /subversion/trunk/subversion: include/svn_auth.h libsvn_subr/config_file.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 18:36:16 2011
New Revision: 1150833

URL: http://svn.apache.org/viewvc?rev=1150833view=rev
Log:
Small cleanups related to the new gpg-agent feature. No functional change.

* subversion/include/svn_auth.h
  (svn_auth_get_platform_specific_provider,
   svn_auth_get_platform_specific_client_providers): Mention gpg-agent
in docstrings.

* subversion/libsvn_subr/config_file.c
  (svn_config_ensure): gpg-agent has not been tested on all platforms,
   and we don't compile it on windows. So put it into the Unix-like systems
   group instead of claiming it ran on all platforms.
   Also remove it from the example line that enables keychain on Mac OS X.
   Most Mac users probably prefer keychain and those that don't will be
   smart enough to configure gpg-agent anyway.

Modified:
subversion/trunk/subversion/include/svn_auth.h
subversion/trunk/subversion/libsvn_subr/config_file.c

Modified: subversion/trunk/subversion/include/svn_auth.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_auth.h?rev=1150833r1=1150832r2=1150833view=diff
==
--- subversion/trunk/subversion/include/svn_auth.h (original)
+++ subversion/trunk/subversion/include/svn_auth.h Mon Jul 25 18:36:16 2011
@@ -785,8 +785,8 @@ svn_auth_get_simple_provider(svn_auth_pr
  * svn_auth_provider_object_t, or return @c NULL if the provider is not
  * available for the requested platform or the requested provider is unknown.
  *
- * Valid @a provider_name values are: gnome_keyring, keychain, kwallet
- * and windows.
+ * Valid @a provider_name values are: gnome_keyring, keychain, kwallet,
+ * gpg_agent, and windows.
  *
  * Valid @a provider_type values are: simple, ssl_client_cert_pw and
  * ssl_server_trust.
@@ -818,9 +818,10 @@ svn_auth_get_platform_specific_provider(
  *
  * Default order of the platform-specific authentication providers:
  *   1. gnome-keyring
- *   2. kwallet
- *   3. keychain
- *   4. windows-cryptoapi
+ *   2. gpg-agent
+ *   3. kwallet
+ *   4. keychain
+ *   5. windows-cryptoapi
  *
  * @since New in 1.6.
  */

Modified: subversion/trunk/subversion/libsvn_subr/config_file.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_file.c?rev=1150833r1=1150832r2=1150833view=diff
==
--- subversion/trunk/subversion/libsvn_subr/config_file.c (original)
+++ subversion/trunk/subversion/libsvn_subr/config_file.c Mon Jul 25 18:36:16 
2011
@@ -954,11 +954,11 @@ svn_config_ensure(const char *config_dir
 ### Valid password stores: NL
 ###   gnome-keyring(Unix-like systems) NL
 ###   kwallet  (Unix-like systems) NL
+###   gpg-agent(Unix-like systems) NL
 ###   keychain (Mac OS X)  NL
 ###   windows-cryptoapi(Windows)   NL
-###   gpg-agent(All platforms) NL
 #ifdef SVN_HAVE_KEYCHAIN_SERVICES
-# password-stores = keychain,gpg-agent NL
+# password-stores = keychain   NL
 #elif defined(WIN32)  !defined(__MINGW32__)
 # password-stores = windows-cryptoapi  NL
 #else




svn commit: r1150841 - /subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 18:45:57 2011
New Revision: 1150841

URL: http://svn.apache.org/viewvc?rev=1150841view=rev
Log:
* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): We can pass the full BUFFER_SIZE to
   receive_from_gpg_agent() and send_option() because they will
   NUL-terminate. (Historically these were arguments to recv() and
   send() which do not.)

Found by: danielsh

Modified:
subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150841r1=1150840r2=1150841view=diff
==
--- subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 
18:45:57 2011
@@ -179,7 +179,7 @@ password_get_gpg_agent(const char **pass
 
   /* Receive the connection status from the gpg-agent daemon. */
   buffer = apr_palloc(pool, BUFFER_SIZE);
-  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
 {
   close(sd);
   return FALSE;
@@ -195,7 +195,7 @@ password_get_gpg_agent(const char **pass
   tty_name = getenv(GPG_TTY);
   if (tty_name != NULL)
 {
-  if (!send_option(sd, buffer, BUFFER_SIZE - 1, ttyname, tty_name, pool))
+  if (!send_option(sd, buffer, BUFFER_SIZE, ttyname, tty_name, pool))
 {
   close(sd);
   return FALSE;
@@ -211,7 +211,7 @@ password_get_gpg_agent(const char **pass
   tty_type = getenv(TERM);
   if (tty_type != NULL)
 {
-  if (!send_option(sd, buffer, BUFFER_SIZE - 1, ttytype, tty_type, pool))
+  if (!send_option(sd, buffer, BUFFER_SIZE, ttytype, tty_type, pool))
 {
   close(sd);
   return FALSE;
@@ -231,7 +231,7 @@ password_get_gpg_agent(const char **pass
 lc_ctype = getenv(LANG);
   if (lc_ctype != NULL)
 {
-  if (!send_option(sd, buffer, BUFFER_SIZE - 1, lc-ctype, lc_ctype, 
pool))
+  if (!send_option(sd, buffer, BUFFER_SIZE, lc-ctype, lc_ctype, pool))
 {
   close(sd);
   return FALSE;
@@ -243,7 +243,7 @@ password_get_gpg_agent(const char **pass
   if (display != NULL)
 {
   request = apr_psprintf(pool, OPTION display=%s\n, display);
-  if (!send_option(sd, buffer, BUFFER_SIZE - 1, display, display, pool))
+  if (!send_option(sd, buffer, BUFFER_SIZE, display, display, pool))
 {
   close(sd);
   return FALSE;
@@ -278,7 +278,7 @@ password_get_gpg_agent(const char **pass
   close(sd);
   return FALSE;
 }
-  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE - 1))
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
 {
   close(sd);
   return FALSE;




svn commit: r1150870 - /subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 20:00:58 2011
New Revision: 1150870

URL: http://svn.apache.org/viewvc?rev=1150870view=rev
Log:
* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): Write the correct number of bytes to the
   socket when sending the GET_PASSPHRASE command. We used to send one
   (random) byte too much, which the agent will interpret as the first
   byte of the next command we send.

Modified:
subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150870r1=1150869r2=1150870view=diff
==
--- subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 
20:00:58 2011
@@ -275,7 +275,7 @@ password_get_gpg_agent(const char **pass
  escape_blanks(password_prompt),
  escape_blanks(realm_prompt));
 
-  if (write(sd, request, strlen(request) + 1) == -1)
+  if (write(sd, request, strlen(request)) == -1)
 {
   close(sd);
   return FALSE;




svn commit: r1150875 - /subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 20:07:30 2011
New Revision: 1150875

URL: http://svn.apache.org/viewvc?rev=1150875view=rev
Log:
* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): Verify that the agent shares our idea about
   which socket we used to connect to the agent. The GPG-Agent documentation
   says that clients should refuse to connect to an agent with a socket
   name that differs from the client's configuration.

Modified:
subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150875r1=1150874r2=1150875view=diff
==
--- subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 
20:07:30 2011
@@ -136,7 +136,7 @@ password_get_gpg_agent(const char **pass
   char *buffer;
   
   apr_array_header_t *socket_details;
-  char *request = NULL;
+  const char *request = NULL;
   const char *cache_id = NULL;
   struct sockaddr_un addr;
   const char *tty_name;
@@ -191,6 +191,47 @@ password_get_gpg_agent(const char **pass
   return FALSE;
 }
 
+  /* The GPG-Agent documentation says:
+   *  Clients should deny to access an agent with a socket name which does
+   *   not match its own configuration. */
+  request = GETINFO socket_name\n;
+  if (write(sd, request, strlen(request)) == -1)
+{
+  close(sd);
+  return FALSE;
+}
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
+{
+  close(sd);
+  return FALSE;
+}
+  if (strncmp(buffer, D, 1) == 0)
+p = buffer[2];
+  if (!p)
+{
+  close(sd);
+  return FALSE;
+}
+  ep = strchr(p, '\n');
+  if (ep != NULL)
+*ep = '\0';
+  if (strcmp(socket_name, p) != 0)
+{
+  close(sd);
+  return FALSE;
+}
+  /* The agent will terminate its reponse with OK. */
+  if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
+{
+  close(sd);
+  return FALSE;
+}
+  if (strncmp(buffer, OK, 2) != 0)
+{
+  close(sd);
+  return FALSE;
+}
+
   /* Send TTY_NAME to the gpg-agent daemon. */
   tty_name = getenv(GPG_TTY);
   if (tty_name != NULL)




svn commit: r1150884 - /subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 20:24:17 2011
New Revision: 1150884

URL: http://svn.apache.org/viewvc?rev=1150884view=rev
Log:
* subversion/libsvn_auth_gpg_agent/gpg_agent.c
  (password_get_gpg_agent): Reinitialise local variable P to NULL before
   using it a second time.

Found by: danielsh

Modified:
subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150884r1=1150883r2=1150884view=diff
==
--- subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 
20:24:17 2011
@@ -332,6 +332,7 @@ password_get_gpg_agent(const char **pass
   if (strncmp(buffer, ERR, 3) == 0)
 return FALSE;
   
+  p = NULL;
   if (strncmp(buffer, D, 1) == 0)
 p = buffer[2];
 




svn commit: r1150950 - in /subversion/trunk: ./ build/generator/ subversion/bindings/swig/ subversion/include/ subversion/libsvn_auth_gpg_agent/ subversion/libsvn_subr/

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 23:00:20 2011
New Revision: 1150950

URL: http://svn.apache.org/viewvc?rev=1150950view=rev
Log:
Remove libsvn_auth_gpg_agent and move gpg-agent support into libsvn_subr.

There is no need to put gpg-agent support into a library loaded at runtime.
The svn code talks to the GPG agent via a UNIX stream socket.
There are no massive external library dependencies involved that
we need to keep at a distance, as with GNOME or KDE.

This should also fix the problem where svn fails to enable gpg-agent
support on Mac OS X because of a filename mismatch (*.so vs. *.dylib).

* subversion/include/svn_auth.h
  (svn_auth_gpg_agent_version): Remove declaration. A version function
   is only needed for DSOs.
  (svn_auth_get_gpg_agent_simple_provider): Declare this function on Darwin.
   Remove mention of libsvn_auth_gpg_agent from docstring.

* subversion/libsvn_auth_gpg_agent,
  subversion/libsvn_auth_gpg_agent/version.c: Remove.

* subversion/libsvn_auth_gpg_agent/gpg_agent.c: Move to ...

* subversion/libsvn_subr/gpg_agent.c: ... here. Wrap all code into
   the SVN_HAVE_GPG_AGENT define.

* subversion/libsvn_subr/auth.c
  (svn_auth_get_platform_specific_provider): Directly call
   svn_auth_get_gpg_agent_simple_provider() if SVN_HAVE_GPG_AGENT is defined
   instead of loading gpg-agent support as a DSO.

* subversion/bindings/swig/core.i: Remove svn_auth_gpg_agent_version.

* configure.ac,
  build.conf,
  build/generator/gen_make.py,
  build/generator/gen_win.py: Remove references to libsvn_auth_gpg_agent.

Added:
subversion/trunk/subversion/libsvn_subr/gpg_agent.c
  - copied, changed from r1150916, 
subversion/trunk/subversion/libsvn_auth_gpg_agent/gpg_agent.c
Removed:
subversion/trunk/subversion/libsvn_auth_gpg_agent/
Modified:
subversion/trunk/build.conf
subversion/trunk/build/generator/gen_make.py
subversion/trunk/build/generator/gen_win.py
subversion/trunk/configure.ac
subversion/trunk/subversion/bindings/swig/core.i
subversion/trunk/subversion/include/svn_auth.h
subversion/trunk/subversion/libsvn_subr/auth.c

Modified: subversion/trunk/build.conf
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1150950r1=1150949r2=1150950view=diff
==
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Mon Jul 25 23:00:20 2011
@@ -174,14 +174,6 @@ libs = libsvn_client libsvn_ra libsvn_re
 install = bin
 manpages = subversion/svnrdump/svnrdump.1
 
-# Support for GPG Agent
-[libsvn_auth_gpg_agent]]
-description = Subversion GPG Agent library
-type = lib
-install = gpg-agent-lib
-path = subversion/libsvn_auth_gpg_agent
-libs = apr libsvn_subr
-
 # Support for GNOME Keyring
 [libsvn_auth_gnome_keyring]
 description = Subversion GNOME Keyring Library

Modified: subversion/trunk/build/generator/gen_make.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_make.py?rev=1150950r1=1150949r2=1150950view=diff
==
--- subversion/trunk/build/generator/gen_make.py (original)
+++ subversion/trunk/build/generator/gen_make.py Mon Jul 25 23:00:20 2011
@@ -531,8 +531,7 @@ DIR=`pwd`
 ''')
 libdep_cache = {}
 paths = {}
-for lib in ('libsvn_auth_gnome_keyring', 'libsvn_auth_kwallet',
-'libsvn_auth_gpg_agent'):
+for lib in ('libsvn_auth_gnome_keyring', 'libsvn_auth_kwallet'):
   paths[lib] = self.sections[lib].options.get('path')
 for target_ob in install_sources:
   if not isinstance(target_ob, gen_base.TargetExe):
@@ -564,8 +563,7 @@ DIR=`pwd`
 for lib in self._get_all_lib_deps(lib_name, libdep_cache, paths):
   libs.add(lib)
   if target_name == 'libsvn_subr':
-libs.update(('libsvn_auth_gnome_keyring', 'libsvn_auth_kwallet',
- 'libsvn_auth_gpg_agent'))
+libs.update(('libsvn_auth_gnome_keyring', 'libsvn_auth_kwallet'))
   libdep_cache[target_name] = sorted(libs)
 return libdep_cache[target_name]
 

Modified: subversion/trunk/build/generator/gen_win.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win.py?rev=1150950r1=1150949r2=1150950view=diff
==
--- subversion/trunk/build/generator/gen_win.py (original)
+++ subversion/trunk/build/generator/gen_win.py Mon Jul 25 23:00:20 2011
@@ -91,8 +91,7 @@ class GeneratorBase(gen_base.GeneratorBa
 self.skip_sections = { 'mod_dav_svn': None,
'mod_authz_svn': None,
'libsvn_auth_kwallet': None,
-   'libsvn_auth_gnome_keyring': None,
-   'libsvn_auth_gpg_agent': None }
+   'libsvn_auth_gnome_keyring': None }
 
 # Instrumentation options
 self.disable_shared = None

Modified: subversion

svn commit: r1150952 - /subversion/trunk/subversion/libsvn_subr/gpg_agent.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 23:07:56 2011
New Revision: 1150952

URL: http://svn.apache.org/viewvc?rev=1150952view=rev
Log:
* subversion/libsvn_subr/gpg_agent.c: Wrap everything in this file
   within #ifndef WIN32 to avoid build problems on Windows.

Modified:
subversion/trunk/subversion/libsvn_subr/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_subr/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?rev=1150952r1=1150951r2=1150952view=diff
==
--- subversion/trunk/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_subr/gpg_agent.c Mon Jul 25 23:07:56 2011
@@ -27,6 +27,8 @@
 
 /*** Includes. ***/
 
+#ifndef WIN32
+
 #include unistd.h
 
 #include sys/socket.h
@@ -424,3 +426,4 @@ svn_auth_get_gpg_agent_simple_provider
 }
 
 #endif /* SVN_HAVE_GPG_AGENT */
+#endif /* !WIN32 */




svn commit: r1150954 - in /subversion/trunk/subversion: include/svn_auth.h libsvn_subr/auth.c

2011-07-25 Thread stsp
Author: stsp
Date: Mon Jul 25 23:25:39 2011
New Revision: 1150954

URL: http://svn.apache.org/viewvc?rev=1150954view=rev
Log:
Move gpg-agent behind GNOME Keyring, Kwallet, and Keychain, by default.
We don't want to disturb existing setups that use existing password
caching mechanisms on *NIX systems.

* subversion/include/svn_auth.h
  (svn_auth_get_platform_specific_provider): Document the new default order.

* subversion/libsvn_subr/auth.c
  (svn_auth_get_platform_specific_client_providers): Add a new macro
   SVN__DEFAULT_AUTH_PROVIDER_LIST that expands to the default list
   of auth providers (previously the list was listed twice).
   Change the list to reflect the priority order described above.

Modified:
subversion/trunk/subversion/include/svn_auth.h
subversion/trunk/subversion/libsvn_subr/auth.c

Modified: subversion/trunk/subversion/include/svn_auth.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_auth.h?rev=1150954r1=1150953r2=1150954view=diff
==
--- subversion/trunk/subversion/include/svn_auth.h (original)
+++ subversion/trunk/subversion/include/svn_auth.h Mon Jul 25 23:25:39 2011
@@ -818,9 +818,9 @@ svn_auth_get_platform_specific_provider(
  *
  * Default order of the platform-specific authentication providers:
  *   1. gnome-keyring
- *   2. gpg-agent
- *   3. kwallet
- *   4. keychain
+ *   2. kwallet
+ *   3. keychain
+ *   4. gpg-agent
  *   5. windows-cryptoapi
  *
  * @since New in 1.6.

Modified: subversion/trunk/subversion/libsvn_subr/auth.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.c?rev=1150954r1=1150953r2=1150954view=diff
==
--- subversion/trunk/subversion/libsvn_subr/auth.c (original)
+++ subversion/trunk/subversion/libsvn_subr/auth.c Mon Jul 25 23:25:39 2011
@@ -500,6 +500,9 @@ svn_auth_get_platform_specific_client_pr
   apr_array_header_t *password_stores;
   int i;
 
+#define SVN__DEFAULT_AUTH_PROVIDER_LIST \
+ gnome-keyring,kwallet,keychain,gpg-agent,windows-cryptoapi
+
   if (config)
 {
   svn_config_get
@@ -507,12 +510,11 @@ svn_auth_get_platform_specific_client_pr
  password_stores_config_option,
  SVN_CONFIG_SECTION_AUTH,
  SVN_CONFIG_OPTION_PASSWORD_STORES,
- gpg-agent,gnome-keyring,kwallet,keychain,windows-cryptoapi);
+ SVN__DEFAULT_AUTH_PROVIDER_LIST);
 }
   else
 {
-  password_stores_config_option =
-gpg-agent,gnome-keyring,kwallet,keychain,windows-cryptoapi;
+  password_stores_config_option = SVN__DEFAULT_AUTH_PROVIDER_LIST;
 }
 
   *providers = apr_array_make(pool, 12, sizeof(svn_auth_provider_object_t *));




svn commit: r1151015 - /subversion/trunk/subversion/tests/cmdline/info_tests.py

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 08:24:17 2011
New Revision: 1151015

URL: http://svn.apache.org/viewvc?rev=1151015view=rev
Log:
* subversion/tests/cmdline/info_tests.py
  (info_show_exclude): Fix indentation and put the expected error string
into a variable instead of spelling it out twice. No functional change.

Patch by: Noorul Islam K M noorul{_AT_}collab.net

Modified:
subversion/trunk/subversion/tests/cmdline/info_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/info_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/info_tests.py?rev=1151015r1=1151014r2=1151015view=diff
==
--- subversion/trunk/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/info_tests.py Tue Jul 26 08:24:17 
2011
@@ -449,8 +449,8 @@ def info_show_exclude(sbox):
 
   expected_info = [{
   'Path' : '.*%siota' % re.escape(os.sep),
- 'Repository Root' : sbox.repo_url,
- 'Repository UUID' : wc_uuid,
+  'Repository Root' : sbox.repo_url,
+  'Repository UUID' : wc_uuid,
   }]
   svntest.main.run_svn(None, 'up', '--set-depth', 'exclude', iota)
   svntest.actions.run_and_verify_info(expected_info, iota)
@@ -469,19 +469,16 @@ def info_show_exclude(sbox):
 
   sbox.simple_rm('iota')
   sbox.simple_commit()
+  
+  expected_error = 'svn: E29: Could not display info for all targets.*'
 
   # Expect error on iota (status = not-present)
-  svntest.actions.run_and_verify_svn(None, [],
-   'svn: E29: Could not display info for all targets.*',
-'info', iota)
+  svntest.actions.run_and_verify_svn(None, [], expected_error, 'info', iota)
 
   sbox.simple_update()
 
   # Expect error on iota (unversioned)
-  svntest.actions.run_and_verify_svn(None, [],
-   'svn: E29: Could not display info for all targets.*',
-'info', iota)
-
+  svntest.actions.run_and_verify_svn(None, [], expected_error, 'info', iota)
 
 
 # Run the tests




svn commit: r1151036 - /subversion/trunk/subversion/po/de.po

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 09:26:41 2011
New Revision: 1151036

URL: http://svn.apache.org/viewvc?rev=1151036view=rev
Log:
* subversion/po/de.po: Fix an error in the German translation of the help
   text of 'svn export'. The text was implying that unversioned files
   were exported under some condititions, which isn't a proper translation
   of the original meaning (such files are never exported).

Found by: Ulrich Eckhardt
http://svn.haxx.se/users/archive-2011-07/0403.shtml

Modified:
subversion/trunk/subversion/po/de.po

Modified: subversion/trunk/subversion/po/de.po
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/po/de.po?rev=1151036r1=1151035r2=1151036view=diff
==
--- subversion/trunk/subversion/po/de.po [UTF-8] (original)
+++ subversion/trunk/subversion/po/de.po [UTF-8] Tue Jul 26 09:26:41 2011
@@ -8506,7 +8506,7 @@ msgstr 
  sonst REV. Ohne Angabe von PFAD2 wird der letzte Abschnitt von PFAD1\n
  als lokaler Verzeichnisname verwendet. Ohne Angabe von REV werden alle\n
  lokalen Änderungen beibehalten. Objekte, die sich nicht unter\n
- Versionskontrolle befinden, werden in diesem Fall auch nicht kopiert.\n
+ Versionskontrolle befinden, werden nicht kopiert.\n
 \n
   PEGREV gibt an, in welcher Revision das Ziel zuerst gesucht wird.\n
 




svn commit: r1151037 - in /subversion/branches/1.7.x: ./ subversion/po/de.po

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 09:28:37 2011
New Revision: 1151037

URL: http://svn.apache.org/viewvc?rev=1151037view=rev
Log:
On the 1.7.x branch, merge r1151036 from trunk (obvious fix).

Modified:
subversion/branches/1.7.x/   (props changed)
subversion/branches/1.7.x/subversion/po/de.po

Propchange: subversion/branches/1.7.x/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 26 09:28:37 2011
@@ -54,4 +54,4 @@
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
 /subversion/branches/uris-as-urls:1060426-1064427
-/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1148071,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149572,1149675
+/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1148071,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149572,1149675,1151036

Modified: subversion/branches/1.7.x/subversion/po/de.po
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/po/de.po?rev=1151037r1=1151036r2=1151037view=diff
==
--- subversion/branches/1.7.x/subversion/po/de.po [UTF-8] (original)
+++ subversion/branches/1.7.x/subversion/po/de.po [UTF-8] Tue Jul 26 09:28:37 
2011
@@ -8506,7 +8506,7 @@ msgstr 
  sonst REV. Ohne Angabe von PFAD2 wird der letzte Abschnitt von PFAD1\n
  als lokaler Verzeichnisname verwendet. Ohne Angabe von REV werden alle\n
  lokalen Änderungen beibehalten. Objekte, die sich nicht unter\n
- Versionskontrolle befinden, werden in diesem Fall auch nicht kopiert.\n
+ Versionskontrolle befinden, werden nicht kopiert.\n
 \n
   PEGREV gibt an, in welcher Revision das Ziel zuerst gesucht wird.\n
 




svn commit: r1151038 - in /subversion/branches/1.6.x: ./ subversion/po/de.po

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 09:29:47 2011
New Revision: 1151038

URL: http://svn.apache.org/viewvc?rev=1151038view=rev
Log:
On the 1.6.x branch, merge r1151036 from trunk (obvious fix).

Modified:
subversion/branches/1.6.x/   (props changed)
subversion/branches/1.6.x/subversion/po/de.po

Propchange: subversion/branches/1.6.x/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 26 09:29:47 2011
@@ -119,4 +119,4 @@
 /subversion/branches/tc_url_rev:874351-874483
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:875965,875968,876004,876012,876017,876019,876022,876024,876032,876041-876042,876048,876051,876055-876056,876059,876083,876091,876097,876101,876104,876109,876123-876125,876129,876132,876138,876160,876167,876175,876180,876185,876205,876223-876225,876230,876233,876245,876252,876256,876283,876287,876312,876326-876327,876330,876366,876372,876374,876376,876383,876386,876442,876456-876457,876462-876464,876467,876469,876480,876486,876495-876497,876516-876518,876524,876526,876583,876601,876614-876615,876628,876633,876641,876645,876659,876687,876689,876705,876715,876726,876760,876763,876794,876804,876815-876816,876821,876825,876837,876840-876841,876843,876849,876857-876858,876862,876873,876890,876897,876905,876908,876925,876931,876934,876948-876949,876953,876987,876993,877011,877014,877016,877028-877029,877038,877119,877127,877146,877157,877191,877195,877203,877211,877230,877234,877237,877243,877249,877259,877261,877304,877319,877407,877437,877441-877442,877453,87745
 
9,877472,877544,877553,877565,877568,877573,877593,877595,877597,877601,877612,877665,877667,877681,877692,877696,877701,877720,877730,877784,877793,877797,877809,877814-877815,877819,877821,877842,877848,877853,877867,877869,877873,877901,877909,877916,877931,877942,877953,877964,877968,877970,877981-877982,878005,878013,878015,878020,878046,878053,878062,878074,878080,878089,878091,878093,878095,878127,878129,878131,878142,878173-878176,878216,878240,878242,878255,878269,878272,878279,878296-878297,878303,878321,878335,878338,878341,878343,878353,878364,878367-878368,878385,878399,878423,878426,878447,878462,878484,878491,878498,878532,878590,878595,878607,878625-878627,878646,878659,878673,878682-878683,878690-878691,878693,878723,878760-878761,878873,878875,878877,878879,878905,878910-878911,878915-878916,878924-878925,878946,878949,878955,878960,878970,878981,879001,879033,879056,879074,879076,879081-879082,879093,879105,879126,879148,879170,879198-879199,879201,879271,
 
879293,879357,879375-879376,879403,879631,879635-879636,879688,879709-879711,879747,879902,879916,879954,879961,879966,879971,880027,880082,880095,880105,880146,880162,880226,880274-880275,880370,880450,880461,880474,880525-880526,880552,881905,884842,886164,886197,888715,888979,889081,889840,891672,892050,892085,895514,895653,896522,896915,898048,898963,899826,899828,900797,901304,901752,902093,902467,904301,904394,904594,905303,905326,906256,906305,906587,907644,908980-908981,917523,917640,918211,922516,923389,923391,926151,926167,927323,927328,931209,931211,931392,931568,932942,933299,934599,934603,935631,935992,935996,937610,939000,939002,939375-939376,944635,945350,946355,946767,947006,948512,948916,949307,950931,950933,951753,952992,953317,955369,957507,958024,959004,959760,961055,961970,962377-962378,964167,964349,964767,965405,965469,965508,979045,979429,980811,981449,981921,984565,984928,984931,991534,992114,996884,997026,997070,997457,997466,997471,997474,138,1
 
60,1000607,1000612,1001009,1002094,1005446,1022675,1024269,1027957,1028084,1028108,1028125,1031165,1031186,1032808,1033166,1033290,1033665,1033685,1033921,1034557,1035745,1036429,1036534,1036978,1037762,1038792,1039040,1041438,1041638,1051632,1051638,1051733,1051744-1051745,1051751,1051761,1051763,1051775,1051778,1051968,1051978,1051988,1052029,1052041,1052068,1053185,1053208,1053233,1053499,1053984,1058269,1058722,1063572-1063573,1063592,1063870,1063946,1064839,1066249,1066270,1066276,1068988,1070912,1071239,1071307,1072084,1072953,1074572,1076730,1076759,1076826,1078954,1081255,1084575,1084581,1084764,1084962,1084978,1086222,1094692,1095654,1098608,1102803,1103665,1104309,1125983,1125998,1126007,1126810,1130303,1130448
+/subversion/trunk:875965,875968,876004,876012,876017,876019,876022,876024,876032,876041-876042,876048,876051,876055-876056,876059,876083,876091,876097,876101,876104,876109,876123-876125,876129,876132,876138,876160,876167,876175,876180,876185,876205,876223-876225,876230,876233,876245,876252,876256,876283,876287,876312,876326-876327,876330,876366,876372,876374,876376,876383,876386,876442,876456-876457,876462-876464,876467,876469,876480,876486,876495-876497,876516-876518,876524,876526,876583,876601,876614-876615,876628,876633,876641,876645,876659,876687,876689,876705,876715,876726,876760,876763,876794,876804,876815

svn commit: r1151041 - /subversion/branches/1.7.x/STATUS

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 09:37:27 2011
New Revision: 1151041

URL: http://svn.apache.org/viewvc?rev=1151041view=rev
Log:
* STATUS: Vote for r1150812.

Modified:
subversion/branches/1.7.x/STATUS

Modified: subversion/branches/1.7.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1151041r1=1151040r2=1151041view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Tue Jul 26 09:37:27 2011
@@ -196,7 +196,7 @@ Candidate changes:
Justification:
  A regression from 1.6.
Votes:
- +1: philip
+ +1: philip, stsp
 
 Veto-blocked changes:
 =




svn commit: r1151044 - /subversion/trunk/subversion/libsvn_wc/info.c

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 09:45:40 2011
New Revision: 1151044

URL: http://svn.apache.org/viewvc?rev=1151044view=rev
Log:
* subversion/libsvn_wc/info.c
  (build_info_for_entry): Remove obsolete comment line. The code
pertaining to this was removed in r1132455.

Patch by: Noorul Islam K M noorul{_AT_}collab.net

Modified:
subversion/trunk/subversion/libsvn_wc/info.c

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1151044r1=1151043r2=1151044view=diff
==
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Tue Jul 26 09:45:40 2011
@@ -285,8 +285,6 @@ build_info_for_node(svn_wc__info2_t **in
   tmpinfo-lock-creation_date = lock-date;
 }
 
-  /* ### Temporary hacks to keep our test suite happy: */
-
   *info = tmpinfo;
   return SVN_NO_ERROR;
 }




svn commit: r1151053 - in /subversion/trunk/subversion/libsvn_subr: auth.c gpg_agent.c

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 10:19:55 2011
New Revision: 1151053

URL: http://svn.apache.org/viewvc?rev=1151053view=rev
Log:
* subversion/libsvn_subr/auth.c,
  subversion/libsvn_subr/gpg_agent.c: As per our coding style guidelines,
   change space-before-paren formatting to no-space-before-paren.
   No functional change.

Modified:
subversion/trunk/subversion/libsvn_subr/auth.c
subversion/trunk/subversion/libsvn_subr/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_subr/auth.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.c?rev=1151053r1=1151052r2=1151053view=diff
==
--- subversion/trunk/subversion/libsvn_subr/auth.c (original)
+++ subversion/trunk/subversion/libsvn_subr/auth.c Tue Jul 26 10:19:55 2011
@@ -382,11 +382,10 @@ svn_auth_ssl_server_cert_info_dup
 }
 
 svn_error_t *
-svn_auth_get_platform_specific_provider
-  (svn_auth_provider_object_t **provider,
-   const char *provider_name,
-   const char *provider_type,
-   apr_pool_t *pool)
+svn_auth_get_platform_specific_provider(svn_auth_provider_object_t **provider,
+const char *provider_name,
+const char *provider_type,
+apr_pool_t *pool)
 {
   *provider = NULL;
 
@@ -490,10 +489,9 @@ svn_auth_get_platform_specific_provider
 }
 
 svn_error_t *
-svn_auth_get_platform_specific_client_providers
-  (apr_array_header_t **providers,
-   svn_config_t *config,
-   apr_pool_t *pool)
+svn_auth_get_platform_specific_client_providers(apr_array_header_t **providers,
+svn_config_t *config,
+apr_pool_t *pool)
 {
   svn_auth_provider_object_t *provider;
   const char *password_stores_config_option;

Modified: subversion/trunk/subversion/libsvn_subr/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?rev=1151053r1=1151052r2=1151053view=diff
==
--- subversion/trunk/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_subr/gpg_agent.c Tue Jul 26 10:19:55 2011
@@ -371,13 +371,12 @@ simple_gpg_agent_first_creds(void **cred
  const char *realmstring,
  apr_pool_t *pool)
 {
-  return svn_auth__simple_first_creds_helper
-   (credentials,
-iter_baton, provider_baton,
-parameters, realmstring,
-password_get_gpg_agent,
-SVN_AUTH__GPG_AGENT_PASSWORD_TYPE,
-pool);
+  return svn_auth__simple_first_creds_helper(credentials,
+ iter_baton, provider_baton,
+ parameters, realmstring,
+ password_get_gpg_agent,
+ SVN_AUTH__GPG_AGENT_PASSWORD_TYPE,
+ pool);
 }
 
 
@@ -390,13 +389,12 @@ simple_gpg_agent_save_creds(svn_boolean_
 const char *realmstring,
 apr_pool_t *pool)
 {
-  return svn_auth__simple_save_creds_helper
-   (saved, credentials,
-provider_baton, parameters,
-realmstring,
-password_set_gpg_agent,
-SVN_AUTH__GPG_AGENT_PASSWORD_TYPE,
-pool);
+  return svn_auth__simple_save_creds_helper(saved, credentials,
+provider_baton, parameters,
+realmstring,
+password_set_gpg_agent,
+SVN_AUTH__GPG_AGENT_PASSWORD_TYPE,
+pool);
 }
 
 
@@ -410,9 +408,8 @@ static const svn_auth_provider_t gpg_age
 
 /* Public API */
 void
-svn_auth_get_gpg_agent_simple_provider
-  (svn_auth_provider_object_t **provider,
-   apr_pool_t *pool)
+svn_auth_get_gpg_agent_simple_provider(svn_auth_provider_object_t **provider,
+   apr_pool_t *pool)
 {
   svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
 




svn commit: r1151068 - /subversion/trunk/subversion/libsvn_subr/cmdline.c

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 12:09:32 2011
New Revision: 1151068

URL: http://svn.apache.org/viewvc?rev=1151068view=rev
Log:
* subversion/libsvn_subr/cmdline.c
  (svn_cmdline_create_auth_baton): Convert 'space-before-paren' formatting
to 'no-space-before-paren' as per our coding style guidelines.

Modified:
subversion/trunk/subversion/libsvn_subr/cmdline.c

Modified: subversion/trunk/subversion/libsvn_subr/cmdline.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cmdline.c?rev=1151068r1=1151067r2=1151068view=diff
==
--- subversion/trunk/subversion/libsvn_subr/cmdline.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cmdline.c Tue Jul 26 12:09:32 2011
@@ -459,8 +459,8 @@ svn_cmdline_create_auth_baton(svn_auth_b
   apr_array_header_t *providers;
 
   /* Populate the registered providers with the platform-specific providers */
-  SVN_ERR(svn_auth_get_platform_specific_client_providers
-(providers, cfg, pool));
+  SVN_ERR(svn_auth_get_platform_specific_client_providers(providers,
+  cfg, pool));
 
   /* If we have a cancellation function, cram it and the stuff it
  needs into the prompt baton. */




svn commit: r1151069 - /subversion/trunk/subversion/libsvn_subr/gpg_agent.c

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 12:11:05 2011
New Revision: 1151069

URL: http://svn.apache.org/viewvc?rev=1151069view=rev
Log:
* subversion/libsvn_subr/gpg_agent.c: Add a comment that explains how this
   auth cache provider operates, including security considerations.

Modified:
subversion/trunk/subversion/libsvn_subr/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_subr/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?rev=1151069r1=1151068r2=1151069view=diff
==
--- subversion/trunk/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_subr/gpg_agent.c Tue Jul 26 12:11:05 2011
@@ -23,6 +23,36 @@
 
 /*  */
 
+/* This auth provider stores a plaintext password in memory managed by
+ * a running gpg-agent. In contrast to other password store providers
+ * it does not save the password to disk.
+ *
+ * Prompting is performed by the gpg-agent using a pinentry program
+ * which needs to be installed separately. There are several pinentry
+ * implementations with different front-ends (e.g. qt, gtk, ncurses).
+ *
+ * The gpg-agent will let the password time out after a while,
+ * or immediately when it receives the SIGHUP signal.
+ * When the password has timed out it will automatically prompt the
+ * user for the password again. This is transparent to Subversion.
+ *
+ * SECURITY CONSIDERATIONS:
+ *
+ * Communication to the agent happens over a UNIX socket, which is located
+ * in a directory which only the user running Subversion can access.
+ * However, any program the user runs could access this socket and get
+ * the Subversion password if the program knows the cache ID Subversion
+ * uses for the password.
+ * The cache ID is very easy to obtain for programs running as the same user.
+ * Subversion uses the MD5 of the realmstring as cache ID, and these checksums
+ * are also used as filenames within ~/.subversion/auth/svn.simple.
+ * Unlike GNOME Keyring or KDE Wallet, the user is not prompted for
+ * permission if another program attempts to access the password.
+ *
+ * Therefore, while the gpg-agent is running and has the password cached,
+ * this provider is no more secure than a file storing the password in
+ * plaintext.
+ */
 
 
 /*** Includes. ***/




svn commit: r1151073 - /subversion/trunk/subversion/libsvn_subr/gpg_agent.c

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 12:25:27 2011
New Revision: 1151073

URL: http://svn.apache.org/viewvc?rev=1151073view=rev
Log:
* subversion/libsvn_subr/gpg_agent.c
  (password_set_gpg_agent): Fix typo in comment.
  (simple_gpg_agent_first_creds): Add docstring.
   simple_gpg_agent_save_creds): Change docstring. The old docstring
was wrong because this provider does not encrypt anything.

Modified:
subversion/trunk/subversion/libsvn_subr/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_subr/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?rev=1151073r1=1151072r2=1151073view=diff
==
--- subversion/trunk/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_subr/gpg_agent.c Tue Jul 26 12:25:27 2011
@@ -254,7 +254,7 @@ password_get_gpg_agent(const char **pass
   close(sd);
   return FALSE;
 }
-  /* The agent will terminate its reponse with OK. */
+  /* The agent will terminate its response with OK. */
   if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
 {
   close(sd);
@@ -393,6 +393,7 @@ password_set_gpg_agent(apr_hash_t *creds
 }
 
 
+/* An implementation of svn_auth_provider_t::first_credentials() */
 static svn_error_t *
 simple_gpg_agent_first_creds(void **credentials,
  void **iter_baton,
@@ -410,7 +411,7 @@ simple_gpg_agent_first_creds(void **cred
 }
 
 
-/* Save encrypted credentials to the simple provider's cache. */
+/* An implementation of svn_auth_provider_t::save_credentials() */
 static svn_error_t *
 simple_gpg_agent_save_creds(svn_boolean_t *saved,
 void *credentials,




svn propchange: r1150870 - svn:log

2011-07-26 Thread stsp
Author: stsp
Revision: 1150870
Modified property: svn:log

Modified: svn:log at Tue Jul 26 12:30:13 2011
--
--- svn:log (original)
+++ svn:log Tue Jul 26 12:30:13 2011
@@ -1,5 +1,5 @@
 * subversion/libsvn_auth_gpg_agent/gpg_agent.c
   (password_get_gpg_agent): Write the correct number of bytes to the
socket when sending the GET_PASSPHRASE command. We used to send one
-   (random) byte too much, which the agent will interpret as the first
+   byte too much (a '\0'), which the agent will interpret as the first
byte of the next command we send.



svn propchange: r1150728 - svn:log

2011-07-26 Thread stsp
Author: stsp
Revision: 1150728
Modified property: svn:log

Modified: svn:log at Tue Jul 26 12:31:33 2011
--
--- svn:log (original)
+++ svn:log Tue Jul 26 12:31:33 2011
@@ -5,9 +5,9 @@ Change the password prompt to match the 
 command line client and allow it to be internationalised.
 
 Also make the pinentry program ask for the password twice.
-It is not easy for users to get rid of an invalid password once it is
-in the agent's cache (the easiest way is probably to kill the agent).
-Asking for the password twice makes such mistakes less likely.
+Users must send SIGHUP to the agent to get rid of an invalid password once
+it is in the agent's cache, which also invalidates any other chached
+passphrases. Asking for the password twice makes such mistakes less likely.
 
 * subversion/libsvn_auth_gpg_agent/gpg_agent.c
   (escape_blanks): New helper functions to escape blanks in GPG-Agent



svn propchange: r1150841 - svn:log

2011-07-26 Thread stsp
Author: stsp
Revision: 1150841
Modified property: svn:log

Modified: svn:log at Tue Jul 26 12:34:58 2011
--
--- svn:log (original)
+++ svn:log Tue Jul 26 12:34:58 2011
@@ -1,7 +1,7 @@
 * subversion/libsvn_auth_gpg_agent/gpg_agent.c
   (password_get_gpg_agent): We can pass the full BUFFER_SIZE to
receive_from_gpg_agent() and send_option() because they will
-   NUL-terminate. (Historically these were arguments to recv() and
-   send() which do not.)
+   NUL-terminate. (Historically these were arguments to recv() which
+   which does not NUL-terminate.)
 
 Found by: danielsh



svn commit: r1151166 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/adm_ops.c libsvn_wc/copy.c libsvn_wc/update_editor.c libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c libsv

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 16:51:23 2011
New Revision: 1151166

URL: http://svn.apache.org/viewvc?rev=1151166view=rev
Log:
Record moved-to information at the delete-half of a move.

* subversion/include/private/svn_wc_private.h
  (svn_wc__delete_internal): Declare.
  
* subversion/libsvn_wc/adm_ops.c
  (svn_wc__delete_internal): New. This is like svn_wc_delete4() but has
   one additional parameter MOVED_TO_ABSPATH. If not NULL, this indicates
   that the delete is the delete-half of a move.
  (svn_wc_delete4): Reimplement as a wrapper around svn_wc__delete_internal().

* subversion/libsvn_wc/wc-queries.sql
  (STMT_INSERT_DELETE_FROM_NODE_RECURSIVE): Adjust to only insert children
   of the node being deleted.
  (STMT_INSERT_DELETE_NODE): New. This statement deletes a single node,
   and allows populating the moved_to column in NODES.

* subversion/libsvn_wc/copy.c
  (svn_wc_move): Call svn_wc__delete_internal() with a MOVED_TO_ABSPATH
   instead of calling svn_wc_delete4().

* subversion/libsvn_wc/wc_db.c
  (op_delete_baton_t): Add new field MOVED_TO_RELPATH.
  (op_delete_txn): Use STMT_INSERT_DELETE_NODE to delete LOCAL_ABSPATH
   itself, and possibly mark LOCAL_ABSPATH has having been moved elsewhere.
   Use STMT_INSERT_DELETE_FROM_NODE_RECURSIVE to delete children of
   LOCAL_ABSPATH (before, this statement was also used to delete LOCAL_ABSPATH
   itself).
  (svn_wc__db_op_delete): New parameter MOVED_TO_ABSPATH. Convert this to
   a relpath and put that into the op_delete baton.
  (scan_deletion_txn): Update a comment that referred to the BASE_NODE table.
   This is now called NODES_BASE in the query this code is evaluating.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_op_delete): Add MOVED_TO_ABSPATH parameter and update docstring.

* subversion/tests/libsvn_wc/op-depth-test.c,
  subversion/libsvn_wc/update_editor.c
  (do_delete, add_directory): Adjust calls to svn_wc__db_op_delete().

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/copy.c
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1151166r1=1151165r2=1151166view=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Tue Jul 26 
16:51:23 2011
@@ -1096,6 +1096,21 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
  void *cancel_baton,
  apr_pool_t *scratch_pool);
 
+/* Internal version of svn_wc_delete4(). It has one additional parameter,
+ * MOVED_TO_ABSPATH. If not NULL, this parameter indicates that the
+ * delete operation is the delete-half of a move. */
+svn_error_t *
+svn_wc__delete_internal(svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+svn_boolean_t keep_local,
+svn_boolean_t delete_unversioned_target,
+const char *moved_to_abspath,
+svn_cancel_func_t cancel_func,
+void *cancel_baton,
+svn_wc_notify_func2_t notify_func,
+void *notify_baton,
+apr_pool_t *scratch_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1151166r1=1151165r2=1151166view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Tue Jul 26 16:51:23 2011
@@ -595,15 +595,16 @@ erase_unversioned_from_wc(const char *pa
 
 
 svn_error_t *
-svn_wc_delete4(svn_wc_context_t *wc_ctx,
-   const char *local_abspath,
-   svn_boolean_t keep_local,
-   svn_boolean_t delete_unversioned_target,
-   svn_cancel_func_t cancel_func,
-   void *cancel_baton,
-   svn_wc_notify_func2_t notify_func,
-   void *notify_baton,
-   apr_pool_t *scratch_pool)
+svn_wc__delete_internal(svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+svn_boolean_t keep_local,
+svn_boolean_t delete_unversioned_target,
+const char *moved_to_abspath,
+svn_cancel_func_t cancel_func

svn commit: r1151260 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

2011-07-26 Thread stsp
Author: stsp
Date: Tue Jul 26 21:45:36 2011
New Revision: 1151260

URL: http://svn.apache.org/viewvc?rev=1151260view=rev
Log:
Rename the new_revert_* functions to just revert_*. It is confusing
to have functions called new_something when the old implementation
is already obsolete (as of r1088811).

* subversion/libsvn_wc/adm_ops.c
  (new_revert_internal, new_revert_changelist,
   new_revert_partial): Rename to ...
  (revert_internal, revert_changelist, revert_partial): ... these, respectively.
  (svn_wc_revert4): Update caller.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1151260r1=1151259r2=1151260view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Tue Jul 26 21:45:36 2011
@@ -1602,15 +1602,15 @@ revert_restore(svn_wc__db_t *db,
 /* Revert tree LOCAL_ABSPATH to depth DEPTH and notify for all
reverts. */
 static svn_error_t *
-new_revert_internal(svn_wc__db_t *db,
-const char *local_abspath,
-svn_depth_t depth,
-svn_boolean_t use_commit_times,
-svn_cancel_func_t cancel_func,
-void *cancel_baton,
-svn_wc_notify_func2_t notify_func,
-void *notify_baton,
-apr_pool_t *scratch_pool)
+revert_internal(svn_wc__db_t *db,
+const char *local_abspath,
+svn_depth_t depth,
+svn_boolean_t use_commit_times,
+svn_cancel_func_t cancel_func,
+void *cancel_baton,
+svn_wc_notify_func2_t notify_func,
+void *notify_baton,
+apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
 
@@ -1652,16 +1652,16 @@ new_revert_internal(svn_wc__db_t *db,
 /* Revert files in LOCAL_ABSPATH to depth DEPTH that match
CHANGELIST_HASH and notify for all reverts. */
 static svn_error_t *
-new_revert_changelist(svn_wc__db_t *db,
-  const char *local_abspath,
-  svn_depth_t depth,
-  svn_boolean_t use_commit_times,
-  apr_hash_t *changelist_hash,
-  svn_cancel_func_t cancel_func,
-  void *cancel_baton,
-  svn_wc_notify_func2_t notify_func,
-  void *notify_baton,
-  apr_pool_t *scratch_pool)
+revert_changelist(svn_wc__db_t *db,
+  const char *local_abspath,
+  svn_depth_t depth,
+  svn_boolean_t use_commit_times,
+  apr_hash_t *changelist_hash,
+  svn_cancel_func_t cancel_func,
+  void *cancel_baton,
+  svn_wc_notify_func2_t notify_func,
+  void *notify_baton,
+  apr_pool_t *scratch_pool)
 {
   apr_pool_t *iterpool;
   const apr_array_header_t *children;
@@ -1673,11 +1673,11 @@ new_revert_changelist(svn_wc__db_t *db,
   /* Revert this node (depth=empty) if it matches one of the changelists.  */
   if (svn_wc__internal_changelist_match(db, local_abspath, changelist_hash,
 scratch_pool))
-SVN_ERR(new_revert_internal(db, local_abspath,
-svn_depth_empty, use_commit_times,
-cancel_func, cancel_baton,
-notify_func, notify_baton,
-scratch_pool));
+SVN_ERR(revert_internal(db, local_abspath,
+svn_depth_empty, use_commit_times,
+cancel_func, cancel_baton,
+notify_func, notify_baton,
+scratch_pool));
 
   if (depth == svn_depth_empty)
 return SVN_NO_ERROR;
@@ -1707,11 +1707,11 @@ new_revert_changelist(svn_wc__db_t *db,
 const char *),
   iterpool);
 
-  SVN_ERR(new_revert_changelist(db, child_abspath, depth,
-use_commit_times, changelist_hash,
-cancel_func, cancel_baton,
-notify_func, notify_baton,
-iterpool));
+  SVN_ERR(revert_changelist(db, child_abspath, depth,
+use_commit_times, changelist_hash,
+cancel_func, cancel_baton,
+notify_func, notify_baton,
+iterpool));
 }
 
   svn_pool_destroy(iterpool);
@@ -1729,15 +1729,15 @@ new_revert_changelist(svn_wc__db_t *db,
### the non-recursive revert

svn commit: r1151390 - /subversion/site/publish/index.html

2011-07-27 Thread stsp
Author: stsp
Date: Wed Jul 27 09:00:50 2011
New Revision: 1151390

URL: http://svn.apache.org/viewvc?rev=1151390view=rev
Log:
* site/publish/index.html: Fix link to 1.7 release notes.
Found by: Karl Heinz Marbaise

Modified:
subversion/site/publish/index.html

Modified: subversion/site/publish/index.html
URL: 
http://svn.apache.org/viewvc/subversion/site/publish/index.html?rev=1151390r1=1151389r2=1151390view=diff
==
--- subversion/site/publish/index.html (original)
+++ subversion/site/publish/index.html Wed Jul 27 09:00:50 2011
@@ -76,7 +76,7 @@
  and maintainers.  Please see the
  a href=http://svn.haxx.se/dev/archive-2011-07/0696.shtml;release
  announcement/a for more information about this release, and the
- a href=/docs/release-notes/1.7.0.htmlrelease notes/a and 
+ a href=/docs/release-notes/1.7.htmlrelease notes/a and 
  a 
href=http://svn.apache.org/repos/asf/subversion/tags/1.7.0-beta2/CHANGES; 
  change log/a for information about what will eventually be
  in the 1.7.0 release./p 




svn propchange: r1151590 - svn:log

2011-07-27 Thread stsp
Author: stsp
Revision: 1151590
Modified property: svn:log

Modified: svn:log at Wed Jul 27 19:03:48 2011
--
--- svn:log (original)
+++ svn:log Wed Jul 27 19:03:48 2011
@@ -1,4 +1,4 @@
-Make svn_wc__db_scan_addition() provide information the local source
+Make svn_wc__db_scan_addition() provide information about the local source
 of a move for nodes with a 'moved-here' status.
 
 Some future callers will only want to act on the op-roots involved in



svn commit: r1151780 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 10:11:43 2011
New Revision: 1151780

URL: http://svn.apache.org/viewvc?rev=1151780view=rev
Log:
Make the wc_db internal scan_addition() function return moved-from
information as relative paths, rather than absolute paths. This makes
it easier for other internal functions in wc_db to use moved-from
information provided by scan_addition().

* subversion/libsvn_wc/wc_db.c
  (scan_addition, get_moved_from_info, scan_addition_baton_t): Rename
   MOVED_FROM_ABSPATH and DELETE_OP_ROOT_ABSPATH to MOVED_FROM_RELPATH
   and DELETE_OP_ROOT_RELPATH.
  (scan_addition_txn): Track rename of fields in scan_addition baton.
  (svn_wc__db_scan_addition): Convert moved-from information returned
   by scan_addition() from relative to absolute paths.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1151780r1=1151779r2=1151780view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Jul 28 10:11:43 2011
@@ -366,8 +366,8 @@ scan_addition(svn_wc__db_status_t *statu
   const char **original_repos_relpath,
   apr_int64_t *original_repos_id,
   svn_revnum_t *original_revision,
-  const char **moved_from_abspath,
-  const char **delete_op_root_abspath,
+  const char **moved_from_relpath,
+  const char **delete_op_root_relpath,
   svn_wc__db_wcroot_t *wcroot,
   const char *local_relpath,
   apr_pool_t *result_pool,
@@ -8965,18 +8965,18 @@ svn_wc__db_scan_base_repos(const char **
  * Compute moved-from information for the node at LOCAL_RELPATH which
  * has been determined as having been moved-here.
  * Return an appropriate status in *STATUS (usually moved-here).
- * If MOVED_FROM_ABSPATH is not NULL, set *MOVED_FROM_ABSPATH to the
- * absolute path of the move-source node in *MOVED_FROM_ABSPATH.
- * If DELETE_OP_ROOT_ABSPATH is not NULL, set *DELETE_OP_ROOT_ABSPATH
- * to the absolute path of the op-root of the delete-half of the move.
- * If moved-from information cannot be derived, set both *MOVED_FROM_ABSPATH
- * and *DELETE_OP_ROOT_ABSPATH to NULL, and return a copied status.
+ * If MOVED_FROM_RELPATH is not NULL, set *MOVED_FROM_RELPATH to the
+ * path of the move-source node in *MOVED_FROM_RELPATH.
+ * If DELETE_OP_ROOT_RELPATH is not NULL, set *DELETE_OP_ROOT_RELPATH
+ * to the path of the op-root of the delete-half of the move.
+ * If moved-from information cannot be derived, set both *MOVED_FROM_RELPATH
+ * and *DELETE_OP_ROOT_RELPATH to NULL, and return a copied status.
  * COPY_OPT_ROOT_RELPATH is the relpath of the op-root of the copied-half
  * of the move. */
 static svn_error_t *
 get_moved_from_info(svn_wc__db_status_t *status,
-const char **moved_from_abspath,
-const char **delete_op_root_abspath,
+const char **moved_from_relpath,
+const char **delete_op_root_relpath,
 const char *copy_op_root_relpath,
 svn_wc__db_wcroot_t *wcroot,
 const char *local_relpath,
@@ -8998,10 +8998,10 @@ get_moved_from_info(svn_wc__db_status_t 
* the move operation was interrupted mid-way between the copy
* and the delete. Treat this node as a normal copy. */
   *status = svn_wc__db_status_copied;
-  if (moved_from_abspath)
-*moved_from_abspath = NULL;
-  if (delete_op_root_abspath)
-*delete_op_root_abspath = NULL;
+  if (moved_from_relpath)
+*moved_from_relpath = NULL;
+  if (delete_op_root_relpath)
+*delete_op_root_relpath = NULL;
 
   SVN_ERR(svn_sqlite__reset(stmt));
   return SVN_NO_ERROR;
@@ -9010,30 +9010,25 @@ get_moved_from_info(svn_wc__db_status_t 
   /* It's a properly recorded move. */
   *status = svn_wc__db_status_moved_here;
 
-  if (moved_from_abspath || delete_op_root_abspath)
+  if (moved_from_relpath || delete_op_root_relpath)
 {
-  const char *delete_op_root_relpath;
+  const char *db_delete_op_root_relpath;
 
   /* The moved-from path from the DB is the relpath of
* the op_root of the delete-half of the move. */
-  delete_op_root_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
-
-  /* Return the abspath of the op_root of the delete-half. */
-  if (delete_op_root_abspath)
-*delete_op_root_abspath = svn_dirent_join(wcroot-abspath,
-  delete_op_root_relpath,
-  result_pool);
+  db_delete_op_root_relpath = svn_sqlite__column_text(stmt, 0,
+  result_pool

svn commit: r1151824 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 12:48:58 2011
New Revision: 1151824

URL: http://svn.apache.org/viewvc?rev=1151824view=rev
Log:
Record correct moved-from information for nodes which are moved multiple times.

The sequence svn mv A B; svn mv B C; ended up incorrectly recording
C moved-from B. It must record C moved-from A instead.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_UPDATE_MOVED_TO_RELPATH): New. Updates the moved-to relpath on the
   delete-half of a move. (Note that we update the moved-to column to get
   valid moved-from queries because, in the current implementation,
   moved-from information is inferred by a query on moved-to columns
   and is not actually stored in the DB.)

* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): If the delete is the delete-half of a move, and the
   node being deleted was previously moved-here, fix up the moved-to
   relpath recorded on the delete-half of the original move.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1151824r1=1151823r2=1151824view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu Jul 28 12:48:58 
2011
@@ -1335,6 +1335,13 @@ WHERE wc_id = ?1
 SELECT local_relpath FROM nodes_current
 WHERE wc_id = ?1 AND moved_to = ?2
 
+-- STMT_UPDATE_MOVED_TO_RELPATH
+UPDATE NODES SET moved_to = ?3
+WHERE wc_id = ?1 AND local_relpath = ?2
+  AND op_depth =
+   (SELECT MAX(op_depth) FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth  0)
+
 /* - */
 
 /* Queries for verification. */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1151824r1=1151823r2=1151824view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Jul 28 12:48:58 2011
@@ -6033,6 +6033,7 @@ op_delete_txn(void *baton,
   svn_sqlite__stmt_t *stmt;
   apr_int64_t select_depth; /* Depth of what is to be deleted */
   svn_boolean_t refetch_depth = FALSE;
+  svn_boolean_t is_valid_moved_to_relpath = TRUE;
 
   SVN_ERR(svn_sqlite__exec_statements(wcroot-sdb, STMT_CREATE_DELETE_LIST));
 
@@ -6067,6 +6068,40 @@ op_delete_txn(void *baton,
 }
   SVN_ERR(svn_sqlite__reset(stmt));
 
+  if (b-moved_to_relpath)
+{
+  const char *moved_from_relpath;
+  const char *delete_op_root_relpath;
+
+  /* ### call scan_addition_txn() directly? */
+  if (status == svn_wc__db_status_added)
+SVN_ERR(scan_addition(status, NULL, NULL, NULL,
+  NULL, NULL, NULL,
+  moved_from_relpath,
+  delete_op_root_relpath,
+  wcroot, local_relpath,
+  scratch_pool, scratch_pool));
+
+  if (status == svn_wc__db_status_moved_here 
+  strcmp(moved_from_relpath, delete_op_root_relpath) == 0)
+{
+  /* The node has already been moved and is being moved again.
+   * Update the existing moved_to path at the delete-half of
+   * the prior move. The source of a move is in the BASE tree
+   * so it remains constant if a node is moved around multiple
+   * times. */
+  SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
+STMT_UPDATE_MOVED_TO_RELPATH));
+  SVN_ERR(svn_sqlite__bindf(stmt, iss, wcroot-wc_id,
+moved_from_relpath, b-moved_to_relpath));
+  SVN_ERR(svn_sqlite__step_done(stmt));
+  SVN_ERR(svn_sqlite__reset(stmt));
+
+  /* Make the delete processing below ignore moved-to info. */
+  is_valid_moved_to_relpath = FALSE;
+}
+}
+
   if (op_root)
 {
   svn_boolean_t below_base;
@@ -6134,7 +6169,7 @@ op_delete_txn(void *baton,
   /* Delete the node at LOCAL_RELPATH, and possibly mark it as moved. */
   SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
  STMT_INSERT_DELETE_NODE));
-  if (b-moved_to_relpath)
+  if (b-moved_to_relpath  is_valid_moved_to_relpath)
 SVN_ERR(svn_sqlite__bindf(stmt, isiis,
   wcroot-wc_id, local_relpath,
   select_depth, b-delete_depth,




svn commit: r1151927 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 17:07:16 2011
New Revision: 1151927

URL: http://svn.apache.org/viewvc?rev=1151927view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (scan_addition_txn): Rename the confusingly named local variable
   CURRENT_RELPATH, which always contains the relpath of the op_root,
   or is used to compute it, to the more obvious OP_ROOT_RELPATH.
   Also remove a now redundant comment that explained this non-obvious fact.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1151927r1=1151926r2=1151927view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Jul 28 17:07:16 2011
@@ -9116,7 +9116,7 @@ scan_addition_txn(void *baton,
   apr_pool_t *scratch_pool)
 {
   struct scan_addition_baton_t *sab = baton;
-  const char *current_relpath = local_relpath;
+  const char *op_root_relpath = local_relpath;
   const char *build_relpath = ;
 
   /* Initialize most of the OUT parameters. Generally, we'll only be filling
@@ -9181,20 +9181,20 @@ scan_addition_txn(void *baton,
 
 /* Calculate the op root local path components */
 op_depth = svn_sqlite__column_int64(stmt, 0);
-current_relpath = local_relpath;
+op_root_relpath = local_relpath;
 
 for (i = (int)relpath_depth(local_relpath); i  op_depth; --i)
   {
 /* Calculate the path of the operation root */
 repos_prefix_path =
-  svn_relpath_join(svn_relpath_basename(current_relpath, NULL),
+  svn_relpath_join(svn_relpath_basename(op_root_relpath, NULL),
repos_prefix_path,
scratch_pool);
-current_relpath = svn_relpath_dirname(current_relpath, scratch_pool);
+op_root_relpath = svn_relpath_dirname(op_root_relpath, scratch_pool);
   }
 
 if (sab-op_root_relpath)
-  *sab-op_root_relpath = apr_pstrdup(sab-result_pool, current_relpath);
+  *sab-op_root_relpath = apr_pstrdup(sab-result_pool, op_root_relpath);
 
 if (sab-original_repos_relpath
 || sab-original_repos_id
@@ -9202,13 +9202,13 @@ scan_addition_txn(void *baton,
  *sab-original_revision == SVN_INVALID_REVNUM)
 || sab-status)
   {
-if (local_relpath != current_relpath)
+if (local_relpath != op_root_relpath)
   /* requery to get the add/copy root */
   {
 SVN_ERR(svn_sqlite__reset(stmt));
 
 SVN_ERR(svn_sqlite__bindf(stmt, is,
-  wcroot-wc_id, current_relpath));
+  wcroot-wc_id, op_root_relpath));
 SVN_ERR(svn_sqlite__step(have_row, stmt));
 
 if (!have_row)
@@ -9220,7 +9220,7 @@ scan_addition_txn(void *baton,
 return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
  _(The node '%s' was not found.),
  path_for_error_message(wcroot,
-
current_relpath,
+
op_root_relpath,
 scratch_pool));
   }
 
@@ -9229,8 +9229,6 @@ scan_addition_txn(void *baton,
   *sab-original_revision = svn_sqlite__column_revnum(stmt, 12);
   }
 
-/* current_relpath / current_abspath
-   as well as the record in stmt contain the data of the op_root */
 if (sab-original_repos_relpath)
   *sab-original_repos_relpath = svn_sqlite__column_text(stmt, 11,
 sab-result_pool);
@@ -9250,7 +9248,7 @@ scan_addition_txn(void *baton,
   SVN_ERR(get_moved_from_info(sab-status,
   sab-moved_from_relpath,
   sab-delete_op_root_relpath,
-  current_relpath, wcroot,
+  op_root_relpath, wcroot,
   local_relpath,
   sab-result_pool,
   scratch_pool));
@@ -9272,13 +9270,13 @@ scan_addition_txn(void *baton,
 
 /* Pointing at op_depth, look at the parent */
 repos_prefix_path =
-  svn_relpath_join(svn_relpath_basename(current_relpath, NULL),
+  svn_relpath_join(svn_relpath_basename(op_root_relpath, NULL),
repos_prefix_path,
scratch_pool);
-current_relpath = svn_relpath_dirname(current_relpath, scratch_pool

svn commit: r1151939 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 17:51:08 2011
New Revision: 1151939

URL: http://svn.apache.org/viewvc?rev=1151939view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): Remove local variable IS_VALID_MOVED_TO_RELPATH which
   I added in r1151824 but should have just left out. Its name is misleading,
   its purpose is bogus, and it was always TRUE in the code path where it
   was checked.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1151939r1=1151938r2=1151939view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Jul 28 17:51:08 2011
@@ -6033,7 +6033,6 @@ op_delete_txn(void *baton,
   svn_sqlite__stmt_t *stmt;
   apr_int64_t select_depth; /* Depth of what is to be deleted */
   svn_boolean_t refetch_depth = FALSE;
-  svn_boolean_t is_valid_moved_to_relpath = TRUE;
 
   SVN_ERR(svn_sqlite__exec_statements(wcroot-sdb, STMT_CREATE_DELETE_LIST));
 
@@ -6096,9 +6095,6 @@ op_delete_txn(void *baton,
 moved_from_relpath, b-moved_to_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
-
-  /* Make the delete processing below ignore moved-to info. */
-  is_valid_moved_to_relpath = FALSE;
 }
 }
 
@@ -6169,7 +6165,7 @@ op_delete_txn(void *baton,
   /* Delete the node at LOCAL_RELPATH, and possibly mark it as moved. */
   SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
  STMT_INSERT_DELETE_NODE));
-  if (b-moved_to_relpath  is_valid_moved_to_relpath)
+  if (b-moved_to_relpath)
 SVN_ERR(svn_sqlite__bindf(stmt, isiis,
   wcroot-wc_id, local_relpath,
   select_depth, b-delete_depth,




svn commit: r1151951 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/node.c

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 18:13:31 2011
New Revision: 1151951

URL: http://svn.apache.org/viewvc?rev=1151951view=rev
Log:
Add new libsvn_wc API function svn_wc__node_was_moved_here() which
determines whether a node at a given LOCAL_ABSPATH was moved to this path.

This will be used later, and will also get a companion called
svn_wc__node_was_moved_away() (not implemented yet).

* subversion/include/private/svn_wc_private.h
  (svn_wc__node_was_moved_here): Declare.

* subversion/libsvn_wc/node.c
  (svn_wc__node_was_moved_here): New.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_wc/node.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1151951r1=1151950r2=1151951view=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Thu Jul 28 
18:13:31 2011
@@ -,6 +,25 @@ svn_wc__delete_internal(svn_wc_context_t
 void *notify_baton,
 apr_pool_t *scratch_pool);
 
+/* If the node at LOCAL_ABSPATH was moved here set *MOVED_FROM_ABSPATH to
+ * the absolute path of the deleted move-source node, and set
+ * *DELETE_OP_ROOT_ABSPATH to the absolute path of the root node of the
+ * delete operation.
+ *
+ * If the node was not moved, set *MOVED_FROM_ABSPATH and
+ * *DELETE_OP_ROOT_ABSPATH to NULL.
+ *
+ * Either MOVED_FROM_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
+ * that the caller is not interested in the result.
+ */
+svn_error_t *
+svn_wc__node_was_moved_here(const char **moved_from_abspath,
+const char **delete_op_root_abspath,
+svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+apr_pool_t *result_pool,
+apr_pool_t *scratch_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1151951r1=1151950r2=1151951view=diff
==
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Thu Jul 28 18:13:31 2011
@@ -1766,3 +1766,46 @@ svn_wc__check_for_obstructions(svn_wc_no
   return SVN_NO_ERROR;
 }
 
+
+svn_error_t *
+svn_wc__node_was_moved_here(const char **moved_from_abspath,
+const char **delete_op_root_abspath,
+svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+apr_pool_t *result_pool,
+apr_pool_t *scratch_pool)
+{
+  svn_boolean_t is_added;
+
+  if (moved_from_abspath)
+*moved_from_abspath = NULL;
+  if (delete_op_root_abspath)
+*delete_op_root_abspath = NULL;
+
+  SVN_ERR(svn_wc__node_is_added(is_added, wc_ctx, local_abspath,
+scratch_pool));
+  if (is_added  (moved_from_abspath || delete_op_root_abspath))
+{
+  svn_wc__db_status_t status;
+  const char *db_moved_from_abspath;
+  const char *db_delete_op_root_abspath;
+
+  SVN_ERR(svn_wc__db_scan_addition(status, NULL,
+   NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, db_moved_from_abspath,
+   db_delete_op_root_abspath,
+   wc_ctx-db, local_abspath,
+   scratch_pool, scratch_pool));
+  if (status == svn_wc__db_status_moved_here)
+{
+  if (moved_from_abspath)
+*moved_from_abspath = apr_pstrdup(result_pool,
+  db_moved_from_abspath);
+  if (delete_op_root_abspath)
+*delete_op_root_abspath = apr_pstrdup(result_pool,
+  db_delete_op_root_abspath);
+}
+}
+
+  return SVN_NO_ERROR;
+}




svn commit: r1151960 - /subversion/site/publish/roadmap.html

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 18:36:37 2011
New Revision: 1151960

URL: http://svn.apache.org/viewvc?rev=1151960view=rev
Log:
* site/publish/roadmap.html: Note that improved local move support is
   work-in-progress for 1.8.

Modified:
subversion/site/publish/roadmap.html

Modified: subversion/site/publish/roadmap.html
URL: 
http://svn.apache.org/viewvc/subversion/site/publish/roadmap.html?rev=1151960r1=1151959r2=1151960view=diff
==
--- subversion/site/publish/roadmap.html (original)
+++ subversion/site/publish/roadmap.html Thu Jul 28 18:36:37 2011
@@ -482,6 +482,11 @@ numbering, compatibility, and deprecatio
 td class=task-statusIn Progress/td
 td/td
   /tr
+  tr class=task-level-1 in-progress
+td class=task-nameImproved handling of local moves/renames/td
+td class=task-statusIn Progress/td
+tda href=http://subversion.tigris.org/issues/show_bug.cgi?id=3631;
+Issue 3631/a/td
   /tr
   tr class=task-level-1 not-started
 td class=task-nameReview of performance branch/td




svn commit: r1151962 - /subversion/trunk/notes/moves

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 18:40:56 2011
New Revision: 1151962

URL: http://svn.apache.org/viewvc?rev=1151962view=rev
Log:
* notes/moves: Mention number of the issue which corresponds to this.

Modified:
subversion/trunk/notes/moves

Modified: subversion/trunk/notes/moves
URL: 
http://svn.apache.org/viewvc/subversion/trunk/notes/moves?rev=1151962r1=1151961r2=1151962view=diff
==
--- subversion/trunk/notes/moves (original)
+++ subversion/trunk/notes/moves Thu Jul 28 18:40:56 2011
@@ -7,7 +7,7 @@ This file purposefully talks about 'move
 This isn't about true renames as requested in issue #898.
 Rather, these ideas keep the add+delete concept while trying to make
 moves behave more in a way that one would expect if true renames were
-implemented.
+implemented, as requested in issue #3631.
 
 These ideas only cover local (client-side) moves in the working copy.
 They attempt to reuse as much existing code as possible, so new




svn commit: r1151965 - /subversion/site/publish/roadmap.html

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 18:44:35 2011
New Revision: 1151965

URL: http://svn.apache.org/viewvc?rev=1151965view=rev
Log:
* site/publish/roadmap.html: Add a note to GPG-Agent entry in 1.8 table.

Modified:
subversion/site/publish/roadmap.html

Modified: subversion/site/publish/roadmap.html
URL: 
http://svn.apache.org/viewvc/subversion/site/publish/roadmap.html?rev=1151965r1=1151964r2=1151965view=diff
==
--- subversion/site/publish/roadmap.html (original)
+++ subversion/site/publish/roadmap.html Thu Jul 28 18:44:35 2011
@@ -475,7 +475,8 @@ numbering, compatibility, and deprecatio
   tr class=task-level-1 completed
 td class=task-nameGPG Agent support/td
 td class=task-statusCompleted/td
-td/td
+tdSee comment added in a 
href=http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?r1=1151053r2=1151069;
+this commit/a for more information./td
   /tr
   tr class=task-level-1 in-progress
 td class=task-nameFSFS: Packing of revision property shards/td




svn commit: r1151966 - /subversion/site/publish/roadmap.html

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 18:45:36 2011
New Revision: 1151966

URL: http://svn.apache.org/viewvc?rev=1151966view=rev
Log:
* site/publish/roadmap.html: Fix typo from r1151965.

Modified:
subversion/site/publish/roadmap.html

Modified: subversion/site/publish/roadmap.html
URL: 
http://svn.apache.org/viewvc/subversion/site/publish/roadmap.html?rev=1151966r1=1151965r2=1151966view=diff
==
--- subversion/site/publish/roadmap.html (original)
+++ subversion/site/publish/roadmap.html Thu Jul 28 18:45:36 2011
@@ -475,7 +475,7 @@ numbering, compatibility, and deprecatio
   tr class=task-level-1 completed
 td class=task-nameGPG Agent support/td
 td class=task-statusCompleted/td
-tdSee comment added in a 
href=http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?r1=1151053r2=1151069;
+tdSee comment added in a 
href=http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?r1=1151053r2=1151069;
 this commit/a for more information./td
   /tr
   tr class=task-level-1 in-progress




svn commit: r1151970 - /subversion/site/publish/roadmap.html

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 18:51:06 2011
New Revision: 1151970

URL: http://svn.apache.org/viewvc?rev=1151970view=rev
Log:
* site/public/roadmap.html: Add conflict-storage to 1.8 items (not-started).
   Let's hope we'll get to it in this release cycle.

Modified:
subversion/site/publish/roadmap.html

Modified: subversion/site/publish/roadmap.html
URL: 
http://svn.apache.org/viewvc/subversion/site/publish/roadmap.html?rev=1151970r1=1151969r2=1151970view=diff
==
--- subversion/site/publish/roadmap.html (original)
+++ subversion/site/publish/roadmap.html Thu Jul 28 18:51:06 2011
@@ -490,6 +490,12 @@ numbering, compatibility, and deprecatio
 Issue 3631/a/td
   /tr
   tr class=task-level-1 not-started
+td class=task-nameConflict storage/td
+td class=task-statusNot Started/td
+tdDesign spec is a 
href=http://svn.apache.org/repos/asf/subversion/trunk/notes/wc-ng/conflict-storage;
+   here/a. Implementation was planned for 1.7 but didn't make it./td
+  /tr
+  tr class=task-level-1 not-started
 td class=task-nameReview of performance branch/td
 td class=task-statusNot Started/td
 tdReview items on the a 
href=http://svn.apache.org/repos/asf/subversion/branches/performance/;performance
 branch/a,




svn commit: r1151971 - /subversion/site/publish/roadmap.html

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 18:52:55 2011
New Revision: 1151971

URL: http://svn.apache.org/viewvc?rev=1151971view=rev
Log:
* publish/roadmap.html:  - amp;
Found by: danielsh

Modified:
subversion/site/publish/roadmap.html

Modified: subversion/site/publish/roadmap.html
URL: 
http://svn.apache.org/viewvc/subversion/site/publish/roadmap.html?rev=1151971r1=1151970r2=1151971view=diff
==
--- subversion/site/publish/roadmap.html (original)
+++ subversion/site/publish/roadmap.html Thu Jul 28 18:52:55 2011
@@ -475,7 +475,7 @@ numbering, compatibility, and deprecatio
   tr class=task-level-1 completed
 td class=task-nameGPG Agent support/td
 td class=task-statusCompleted/td
-tdSee comment added in a 
href=http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?r1=1151053r2=1151069;
+tdSee comment added in a 
href=http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?r1=1151053amp;r2=1151069;
 this commit/a for more information./td
   /tr
   tr class=task-level-1 in-progress




svn commit: r1152023 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 22:27:14 2011
New Revision: 1152023

URL: http://svn.apache.org/viewvc?rev=1152023view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_scan_addition): Do not dereference MOVED_FROM_RELPATH
and DELETE_OP_ROOT_RELPATH if scan_deletion() set them to NULL.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152023r1=1152022r2=1152023view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Jul 28 22:27:14 2011
@@ -9442,11 +9442,11 @@ svn_wc__db_scan_addition(svn_wc__db_stat
wcroot-sdb, original_repos_id,
result_pool));
 
-  if (moved_from_abspath)
+  if (moved_from_abspath  moved_from_relpath)
 *moved_from_abspath = svn_dirent_join(wcroot-abspath,
   moved_from_relpath,
   result_pool);
-  if (delete_op_root_abspath)
+  if (delete_op_root_abspath  delete_op_root_relpath)
 *delete_op_root_abspath = svn_dirent_join(wcroot-abspath,
   delete_op_root_relpath,
   result_pool);




svn commit: r1152026 - /subversion/trunk/subversion/libsvn_client/commit.c

2011-07-28 Thread stsp
Author: stsp
Date: Thu Jul 28 22:35:57 2011
New Revision: 1152026

URL: http://svn.apache.org/viewvc?rev=1152026view=rev
Log:
Make commit refuse to commit the copied-half of a move independently of
the delete-half.

It is still possible to commit the delete-half independently of the
copied-half. That will be fixed soon.

This is the first visible behaviour change for moves.
None of our existing tests trigger the new error condition so writing
new tests wouldn't be a bad idea. I'll add some if nobody beats me to it.

* subversion/libsvn_client/commit.c
  (svn_client_commit5): Raise an error if the delete-half corresponding
   to the copied-half of a moved commit target does not appear in the
   commit target list.

Modified:
subversion/trunk/subversion/libsvn_client/commit.c

Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=1152026r1=1152025r2=1152026view=diff
==
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Thu Jul 28 22:35:57 2011
@@ -1356,6 +1356,47 @@ svn_client_commit5(const apr_array_heade
   goto cleanup;
   }
 
+  /* For every target that was moved verify that both halves of the
+   * move are part of the commit. */
+  for (i = 0; i  commit_items-nelts; i++)
+{
+  svn_client_commit_item3_t *item =
+APR_ARRAY_IDX(commit_items, i, svn_client_commit_item3_t *);
+
+  svn_pool_clear(iterpool);
+
+  if (item-state_flags  SVN_CLIENT_COMMIT_ITEM_IS_COPY)
+{
+  const char *moved_from_abspath;
+  const char *delete_op_root_abspath;
+
+  cmt_err = svn_error_trace(svn_wc__node_was_moved_here(
+  moved_from_abspath,
+  delete_op_root_abspath,
+  ctx-wc_ctx, item-path,
+  iterpool, iterpool));
+  if (cmt_err)
+goto cleanup;
+
+  if (moved_from_abspath  delete_op_root_abspath 
+  strcmp(moved_from_abspath, delete_op_root_abspath) == 0 
+  apr_hash_get(committables-by_path, delete_op_root_abspath,
+   APR_HASH_KEY_STRING) == NULL)
+{
+  cmt_err = svn_error_createf(
+  SVN_ERR_ILLEGAL_TARGET, NULL,
+  _(Cannot commit '%s' because it was moved from 
+'%s' which is not part of the commit; both 
+sides of the move must be committed together),
+  svn_dirent_local_style(item-path, iterpool),
+  svn_dirent_local_style(delete_op_root_abspath,
+ iterpool));
+  goto cleanup;
+}
+}
+  /* ### TODO: check the delete-half, too */
+}
+
   /* Go get a log message.  If an error occurs, or no log message is
  specified, abort the operation. */
   if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))




svn propchange: r1152115 - svn:log

2011-07-29 Thread stsp
Author: stsp
Revision: 1152115
Modified property: svn:log

Modified: svn:log at Fri Jul 29 09:42:46 2011
--
--- svn:log (original)
+++ svn:log Fri Jul 29 09:42:46 2011
@@ -1,7 +1,6 @@
 Add a couple of tests in followup to r1152026.
 
-(There's probably an issue this is associated with, but I'm not sure which one
-it is.  If you know, please update the tests and this log message!)
+These tests belong to issue #3631.
 
 * subversion/tests/cmdline/copy_tests.py
   (commit_copied_half_of_move, commit_deleted_half_of_move): New.



svn commit: r1152153 - /subversion/trunk/subversion/tests/cmdline/copy_tests.py

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 09:55:26 2011
New Revision: 1152153

URL: http://svn.apache.org/viewvc?rev=1152153view=rev
Log:
* subversion/tests/cmdline/copy_tests.py
  (commit_copied_half_of_move, commit_deleted_half_of_move): Add issue number.

Modified:
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1152153r1=1152152r2=1152153view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Fri Jul 29 09:55:26 
2011
@@ -5442,6 +5442,7 @@ def copy_and_move_conflicts(sbox):
   svntest.actions.verify_disk(wc('move-dest'), expected_disk, True)
 
 
+@Issue(3631)
 def commit_copied_half_of_move(sbox):
   attempt to commit the copied part of move
   sbox.build(read_only = True)
@@ -5457,6 +5458,7 @@ def commit_copied_half_of_move(sbox):
  'commit', '-m', 'foo', D_path)
 
 
+@Issue(3631)
 @XFail()
 def commit_deleted_half_of_move(sbox):
   attempt to commit the deleted part of move




svn commit: r1152154 - /subversion/branches/1.7.x/STATUS

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 10:07:20 2011
New Revision: 1152154

URL: http://svn.apache.org/viewvc?rev=1152154view=rev
Log:
* STATUS: Vote for r1152129.

Modified:
subversion/branches/1.7.x/STATUS

Modified: subversion/branches/1.7.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1152154r1=1152153r2=1152154view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Fri Jul 29 10:07:20 2011
@@ -188,7 +188,7 @@ Candidate changes:
Justification:
  Use the APR API properly.  Resolves a valgrind warning.
Votes:
- +1: danielsh
+ +1: danielsh, stsp
 
 Veto-blocked changes:
 =




svn commit: r1152204 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/node.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 13:12:39 2011
New Revision: 1152204

URL: http://svn.apache.org/viewvc?rev=1152204view=rev
Log:
Add a new internal API function: svn_wc__node_get_deleted_ancestor().

This will be needed for handling moves during commit processing.

* subversion/include/private/svn_wc_private.h
  (svn_wc__node_get_deleted_ancestor): Declare.

* subversion/libsvn_wc/node.c
  (svn_wc__node_get_deleted_ancestor): Implement. This function returns
   the absolute path of the deletion op-root of a given deleted LOCAL_ABSPATH.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_wc/node.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1152204r1=1152203r2=1152204view=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Fri Jul 29 
13:12:39 2011
@@ -466,6 +466,22 @@ svn_wc__node_is_status_deleted(svn_boole
apr_pool_t *scratch_pool);
 
 /**
+ * Set @a *deleted_ancestor_abspath to the root of the delete operation
+ * that deleted @a local_abspath. If @a local_abspath itself was deleted
+ * and has no deleted ancestor, @a *deleted_ancestor_abspath will equal
+ * @a local_abspath. If @a local_abspath was not deleted,
+ * set @a *deleted_ancestor_abspath to @c NULL.
+ * @a *deleted_ancestor_abspath is allocated in @a result_pool.
+ * Use @a scratch_pool for all temporary allocations.
+ */ 
+svn_error_t *
+svn_wc__node_get_deleted_ancestor(const char **deleted_ancestor_abspath,
+  svn_wc_context_t *wc_ctx,
+  const char *local_abspath,
+  apr_pool_t *result_pool,
+  apr_pool_t *scratch_pool);
+
+/**
  * Set @a *is_server_excluded to whether @a local_abspath has been
  * excluded by the server, using @a wc_ctx.  If @a local_abspath is not
  * in the working copy, return @c SVN_ERR_WC_PATH_NOT_FOUND.

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1152204r1=1152203r2=1152204view=diff
==
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Fri Jul 29 13:12:39 2011
@@ -748,6 +748,33 @@ svn_wc__node_is_status_deleted(svn_boole
 }
 
 svn_error_t *
+svn_wc__node_get_deleted_ancestor(const char **deleted_ancestor_abspath,
+  svn_wc_context_t *wc_ctx,
+  const char *local_abspath,
+  apr_pool_t *result_pool,
+  apr_pool_t *scratch_pool)
+{
+  svn_wc__db_status_t status;
+
+  *deleted_ancestor_abspath = NULL;
+
+  SVN_ERR(svn_wc__db_read_info(status,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL,
+   wc_ctx-db, local_abspath,
+   scratch_pool, scratch_pool));
+
+  if (status == svn_wc__db_status_deleted)
+SVN_ERR(svn_wc__db_scan_deletion(deleted_ancestor_abspath, NULL, NULL,
+ wc_ctx-db, local_abspath,
+ result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_wc__node_is_status_server_excluded(svn_boolean_t *is_server_excluded,
svn_wc_context_t *wc_ctx,
const char *local_abspath,




svn commit: r1152245 - in /subversion/trunk/subversion: libsvn_client/commit.c libsvn_wc/wc_db.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 14:48:18 2011
New Revision: 1152245

URL: http://svn.apache.org/viewvc?rev=1152245view=rev
Log:
Update moved-to information on the BASE path of a node which is being moved
out of, or within, an existing moved subtree. Also, make 'svn commit' deal
with the add-half of such moves correctly.

* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): If the node was moved-here and we are moving it away,
   we always want to update moved-to in BASE, regardless of whether the node
   itself was the op-root of the move that moved it here. Prior to this
   commit, we only updated moved-to if the node itself was the op-root.

* subversion/libsvn_client/commit.c
  (svn_client_commit5): If the delete-half of a move is not in the
   commit target list, look up the op-root of the delete and check
   if the op-root is among the commit targets. If it is, the delete-half
   of the move will be committed along with it, and we can allow the commit.

Modified:
subversion/trunk/subversion/libsvn_client/commit.c
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=1152245r1=1152244r2=1152245view=diff
==
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Fri Jul 29 14:48:18 2011
@@ -1379,19 +1379,72 @@ svn_client_commit5(const apr_array_heade
 goto cleanup;
 
   if (moved_from_abspath  delete_op_root_abspath 
-  strcmp(moved_from_abspath, delete_op_root_abspath) == 0 
-  apr_hash_get(committables-by_path, delete_op_root_abspath,
-   APR_HASH_KEY_STRING) == NULL)
+  strcmp(moved_from_abspath, delete_op_root_abspath) == 0)
+
 {
-  cmt_err = svn_error_createf(
-  SVN_ERR_ILLEGAL_TARGET, NULL,
-  _(Cannot commit '%s' because it was moved from 
-'%s' which is not part of the commit; both 
-sides of the move must be committed together),
-  svn_dirent_local_style(item-path, iterpool),
-  svn_dirent_local_style(delete_op_root_abspath,
- iterpool));
-  goto cleanup;
+  svn_boolean_t found_delete_half =
+(apr_hash_get(committables-by_path, delete_op_root_abspath,
+   APR_HASH_KEY_STRING) != NULL);
+  
+  if (!found_delete_half)
+{
+  const char *delete_half_parent_abspath;
+
+  /* The delete-half isn't in the commit target list.
+   * However, it might itself be the child of a deleted node,
+   * either because of another move or a deletion.
+   *
+   * For example, consider: mv A/B B; mv B/C C; commit;
+   * C's moved-from A/B/C is a child of the deleted A/B.
+   * A/B/C does not appear in the commit target list, but
+   * A/B does appear.
+   * (Note that moved-from information is always stored
+   * relative to the BASE tree, so we have 'C moved-from
+   * A/B/C', not 'C moved-from B/C'.)
+   *
+   * An example involving a move and a delete would be:
+   * mv A/B C; rm A; commit;
+   * Now C is moved-from A/B which does not appear in the
+   * commit target list, but A does appear.
+   */
+
+  /* Scan upwards for a deletion op-root from the
+   * delete-half's parent directory. */
+  delete_half_parent_abspath =
+svn_dirent_dirname(delete_op_root_abspath, iterpool);
+  if (strcmp(delete_op_root_abspath,
+ delete_half_parent_abspath) != 0)
+{
+  const char *parent_delete_op_root_abspath;
+
+  cmt_err = svn_error_trace(
+  svn_wc__node_get_deleted_ancestor(
+parent_delete_op_root_abspath,
+ctx-wc_ctx, delete_half_parent_abspath,
+iterpool, iterpool));
+  if (cmt_err)
+goto cleanup;
+
+  if (parent_delete_op_root_abspath)
+found_delete_half =
+  (apr_hash_get(committables-by_path,
+parent_delete_op_root_abspath,
+APR_HASH_KEY_STRING) != NULL

svn commit: r1152246 - /subversion/trunk/subversion/tests/cmdline/copy_tests.py

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 14:50:25 2011
New Revision: 1152246

URL: http://svn.apache.org/viewvc?rev=1152246view=rev
Log:
* subversion/tests/cmdline/copy_tests.py
  (commit_deleted_half_of_nested_move, test_list): New XFail test which
   shows a case where recording of moved-to information doesn't work yet.

Modified:
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1152246r1=1152245r2=1152246view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Fri Jul 29 14:50:25 
2011
@@ -5486,6 +5486,46 @@ def commit_copied_half_of_move(sbox):
   svntest.actions.run_and_verify_svn(None, None, expected_error,
  'commit', '-m', 'foo', D_path)
 
+@Issue(3631)
+@XFail()
+def commit_copied_half_of_nested_move(sbox):
+  attempt to commit the copied part of a nested move
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+
+  iota_path = sbox.ospath('iota')
+  D_path = sbox.ospath('A/D')
+
+  # iota - A/D/iota; verify we cannot commit just A/D
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
+  expected_error = svn: E29: Cannot commit '.*%s' because it was  \
+moved from '.*%s' % (os.path.join(D_path, iota),
+   iota_path)
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+ 'commit', '-m', 'foo', D_path)
+
+  # A/D - A/C/D; verify we cannot commit just A/C
+  C_path = sbox.ospath('A/C')
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_path, C_path)
+  expected_error = svn: E29: Cannot commit '.*%s' because it was  \
+moved from '.*%s' % (os.path.join(C_path, D),
+   D_path)
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+ 'commit', '-m', 'foo', C_path)
+
+  # A/C/D/iota - A/iota; verify that iota's moved-from hasn't changed
+  ### This currently fails because iota's moved-from info isn't updated
+  ### during the A/D-A/C/D move.
+  D_iota_path = sbox.ospath('A/C/D/iota')
+  A_iota_path = sbox.ospath('A/iota')
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_iota_path,
+ A_iota_path)
+  expected_error = svn: E29: Cannot commit '.*%s' because it was  \
+moved from '.*%s' % (A_iota_path, iota_path)
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+ 'commit', '-m', 'foo', A_iota_path)
+
 
 @Issue(3631)
 @XFail()
@@ -5614,6 +5654,7 @@ test_list = [ None,
   copy_and_move_conflicts,
   copy_deleted_dir,
   commit_copied_half_of_move,
+  commit_copied_half_of_nested_move,
   commit_deleted_half_of_move,
  ]
 




svn commit: r1152293 - in /subversion/trunk/subversion: libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c tests/cmdline/copy_tests.py

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 16:25:06 2011
New Revision: 1152293

URL: http://svn.apache.org/viewvc?rev=1152293view=rev
Log:
Fix the problem that prevented copy_test 106 (nested moves) from passing.

* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): If a subtree is being moved-away, update moved-to
   information in BASE for all children that were moved into the subtree.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_MOVED_HERE_CHILDREN): New query.

* subversion/tests/cmdline/copy_tests.py
  (commit_copied_half_of_nested_move): Remove XFail marker.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1152293r1=1152292r2=1152293view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Jul 29 16:25:06 
2011
@@ -1342,6 +1342,10 @@ WHERE wc_id = ?1 AND local_relpath = ?2
(SELECT MAX(op_depth) FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth  0)
 
+-- STMT_SELECT_MOVED_HERE_CHILDREN
+SELECT moved_to, local_relpath FROM nodes_current
+WHERE wc_id = ?1 AND moved_to  ?2 || '/'
+
 /* - */
 
 /* Queries for verification. */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152293r1=1152292r2=1152293view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 16:25:06 2011
@@ -6033,11 +6033,12 @@ op_delete_txn(void *baton,
   svn_sqlite__stmt_t *stmt;
   apr_int64_t select_depth; /* Depth of what is to be deleted */
   svn_boolean_t refetch_depth = FALSE;
+  svn_wc__db_kind_t kind;
 
   SVN_ERR(svn_sqlite__exec_statements(wcroot-sdb, STMT_CREATE_DELETE_LIST));
 
   SVN_ERR(read_info(status,
-NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+kind, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 op_root, NULL, NULL,
 NULL, NULL, NULL,
@@ -6094,6 +6095,76 @@ op_delete_txn(void *baton,
   SVN_ERR(svn_sqlite__step_done(stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
 }
+
+  /* If a subtree is being moved-away, we need to update moved-to
+   * information in BASE for all children that were moved into this
+   * subtree. */
+  if (kind == svn_wc__db_kind_dir)
+{
+  apr_pool_t *iterpool;
+
+  SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
+STMT_SELECT_MOVED_HERE_CHILDREN));
+  SVN_ERR(svn_sqlite__bindf(stmt, is, wcroot-wc_id, local_relpath));
+
+  SVN_ERR(svn_sqlite__step(have_row, stmt));
+
+  iterpool = svn_pool_create(scratch_pool);
+  while (have_row)
+{
+  svn_wc__db_status_t child_status;
+  const char *child_moved_from_relpath;
+  const char *moved_here_child_relpath =
+svn_sqlite__column_text(stmt, 0, scratch_pool);
+
+  svn_pool_clear(iterpool);
+
+  /* The moved-here-children query returns info based on the
+   * delete-half of the move. Check if that the copied-half of
+   * the move matches this information. */
+  SVN_ERR(read_info(child_status, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL,
+wcroot, moved_here_child_relpath,
+iterpool, iterpool));
+  if (child_status == svn_wc__db_status_added)
+SVN_ERR(scan_addition(child_status, NULL, NULL, NULL,
+  NULL, NULL, NULL,
+  child_moved_from_relpath, NULL,
+  wcroot, moved_here_child_relpath,
+  iterpool, iterpool));
+  if (child_status == svn_wc__db_status_moved_here)
+{
+  const char *child_subtree_relpath;
+  const char *new_moved_to_relpath;
+  svn_sqlite__stmt_t *moved_to_stmt;
+
+  /* Compute the new moved-to path for this child

svn commit: r1152294 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 16:28:11 2011
New Revision: 1152294

URL: http://svn.apache.org/viewvc?rev=1152294view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): Add a debug assertion that fails if a move has been
   recorded incorrectly.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152294r1=1152293r2=1152294view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 16:28:11 2011
@@ -6134,6 +6134,15 @@ op_delete_txn(void *baton,
   child_moved_from_relpath, NULL,
   wcroot, moved_here_child_relpath,
   iterpool, iterpool));
+#if SVN_DEBUG
+  /* This catches incorrectly recorded moves.
+   * It is possible to hit this during normal operation
+   * if a move was interrupted mid-way so only perform
+   * this check in debug mode. */
+  SVN_ERR_ASSERT(moved_from_relpath 
+ !strcmp(child_moved_from_relpath,
+ svn_sqlite__column_text(stmt, 1, NULL)));
+#endif
   if (child_status == svn_wc__db_status_moved_here)
 {
   const char *child_subtree_relpath;




svn commit: r1152300 - in /subversion/trunk/subversion: libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c tests/cmdline/copy_tests.py

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 16:53:01 2011
New Revision: 1152300

URL: http://svn.apache.org/viewvc?rev=1152300view=rev
Log:
Temporarily revert r1152293 and r1152294. r1152293 is causing test failures.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1152300r1=1152299r2=1152300view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Jul 29 16:53:01 
2011
@@ -1342,10 +1342,6 @@ WHERE wc_id = ?1 AND local_relpath = ?2
(SELECT MAX(op_depth) FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth  0)
 
--- STMT_SELECT_MOVED_HERE_CHILDREN
-SELECT moved_to, local_relpath FROM nodes_current
-WHERE wc_id = ?1 AND moved_to  ?2 || '/'
-
 /* - */
 
 /* Queries for verification. */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152300r1=1152299r2=1152300view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 16:53:01 2011
@@ -6033,12 +6033,11 @@ op_delete_txn(void *baton,
   svn_sqlite__stmt_t *stmt;
   apr_int64_t select_depth; /* Depth of what is to be deleted */
   svn_boolean_t refetch_depth = FALSE;
-  svn_wc__db_kind_t kind;
 
   SVN_ERR(svn_sqlite__exec_statements(wcroot-sdb, STMT_CREATE_DELETE_LIST));
 
   SVN_ERR(read_info(status,
-kind, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 op_root, NULL, NULL,
 NULL, NULL, NULL,
@@ -6095,85 +6094,6 @@ op_delete_txn(void *baton,
   SVN_ERR(svn_sqlite__step_done(stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
 }
-
-  /* If a subtree is being moved-away, we need to update moved-to
-   * information in BASE for all children that were moved into this
-   * subtree. */
-  if (kind == svn_wc__db_kind_dir)
-{
-  apr_pool_t *iterpool;
-
-  SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
-STMT_SELECT_MOVED_HERE_CHILDREN));
-  SVN_ERR(svn_sqlite__bindf(stmt, is, wcroot-wc_id, local_relpath));
-
-  SVN_ERR(svn_sqlite__step(have_row, stmt));
-
-  iterpool = svn_pool_create(scratch_pool);
-  while (have_row)
-{
-  svn_wc__db_status_t child_status;
-  const char *child_moved_from_relpath;
-  const char *moved_here_child_relpath =
-svn_sqlite__column_text(stmt, 0, scratch_pool);
-
-  svn_pool_clear(iterpool);
-
-  /* The moved-here-children query returns info based on the
-   * delete-half of the move. Check if that the copied-half of
-   * the move matches this information. */
-  SVN_ERR(read_info(child_status, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL, NULL, NULL, NULL,
-wcroot, moved_here_child_relpath,
-iterpool, iterpool));
-  if (child_status == svn_wc__db_status_added)
-SVN_ERR(scan_addition(child_status, NULL, NULL, NULL,
-  NULL, NULL, NULL,
-  child_moved_from_relpath, NULL,
-  wcroot, moved_here_child_relpath,
-  iterpool, iterpool));
-#if SVN_DEBUG
-  /* This catches incorrectly recorded moves.
-   * It is possible to hit this during normal operation
-   * if a move was interrupted mid-way so only perform
-   * this check in debug mode. */
-  SVN_ERR_ASSERT(moved_from_relpath 
- !strcmp(child_moved_from_relpath,
- svn_sqlite__column_text(stmt, 1, NULL)));
-#endif
-  if (child_status == svn_wc__db_status_moved_here)
-{
-  const char *child_subtree_relpath;
-  const char *new_moved_to_relpath;
-  svn_sqlite__stmt_t

svn commit: r1152324 - in /subversion/trunk/subversion: libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c tests/cmdline/copy_tests.py

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 17:46:16 2011
New Revision: 1152324

URL: http://svn.apache.org/viewvc?rev=1152324view=rev
Log:
Restore the changes from r1152293 (which see for log full message),
including the following fix:

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_MOVED_HERE_CHILDREN): Do not select nodes with moved_to
   relpaths that are not children of the ?2 parameter.
   Fixed by changing the condition (moved_to  ?2 || '/') into this:
   (moved_to  ?2 || '/' AND moved_to  ?2 || '0')

Modified:
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1152324r1=1152323r2=1152324view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Jul 29 17:46:16 
2011
@@ -1342,6 +1342,10 @@ WHERE wc_id = ?1 AND local_relpath = ?2
(SELECT MAX(op_depth) FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth  0)
 
+-- STMT_SELECT_MOVED_HERE_CHILDREN
+SELECT moved_to, local_relpath FROM nodes_current
+WHERE wc_id = ?1 AND (moved_to  ?2 || '/' AND moved_to  ?2 || '0')
+
 /* - */
 
 /* Queries for verification. */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152324r1=1152323r2=1152324view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 17:46:16 2011
@@ -6033,11 +6033,12 @@ op_delete_txn(void *baton,
   svn_sqlite__stmt_t *stmt;
   apr_int64_t select_depth; /* Depth of what is to be deleted */
   svn_boolean_t refetch_depth = FALSE;
+  svn_wc__db_kind_t kind;
 
   SVN_ERR(svn_sqlite__exec_statements(wcroot-sdb, STMT_CREATE_DELETE_LIST));
 
   SVN_ERR(read_info(status,
-NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+kind, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 op_root, NULL, NULL,
 NULL, NULL, NULL,
@@ -6094,6 +6095,80 @@ op_delete_txn(void *baton,
   SVN_ERR(svn_sqlite__step_done(stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
 }
+
+  /* If a subtree is being moved-away, we need to update moved-to
+   * information in BASE for all children that were moved into this
+   * subtree. */
+  if (kind == svn_wc__db_kind_dir)
+{
+  apr_pool_t *iterpool;
+
+  SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
+STMT_SELECT_MOVED_HERE_CHILDREN));
+  SVN_ERR(svn_sqlite__bindf(stmt, is, wcroot-wc_id, local_relpath));
+
+  SVN_ERR(svn_sqlite__step(have_row, stmt));
+
+  iterpool = svn_pool_create(scratch_pool);
+  while (have_row)
+{
+  svn_wc__db_status_t child_status;
+  const char *child_moved_from_relpath;
+  const char *child_delete_op_root_relpath;
+  const char *moved_here_child_relpath =
+svn_sqlite__column_text(stmt, 0, scratch_pool);
+
+  svn_pool_clear(iterpool);
+
+  /* The moved-here-children query returns info based on the
+   * delete-half of the move. Check if that the copied-half of
+   * the move matches this information. */
+  SVN_ERR(read_info(child_status, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL, NULL, NULL, NULL,
+wcroot, moved_here_child_relpath,
+iterpool, iterpool));
+  if (child_status == svn_wc__db_status_added)
+SVN_ERR(scan_addition(child_status, NULL, NULL, NULL,
+  NULL, NULL, NULL,
+  child_moved_from_relpath,
+  child_delete_op_root_relpath,
+  wcroot, moved_here_child_relpath,
+  iterpool, iterpool));
+  if (child_status == svn_wc__db_status_moved_here)
+{
+  const char *child_subtree_relpath;
+  const char *new_moved_to_relpath;
+  svn_sqlite__stmt_t *moved_to_stmt

svn commit: r1152326 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 17:48:18 2011
New Revision: 1152326

URL: http://svn.apache.org/viewvc?rev=1152326view=rev
Log:
Restore r1152294 (which see for full log message) unchanged.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152326r1=1152325r2=1152326view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 17:48:18 2011
@@ -6136,6 +6136,15 @@ op_delete_txn(void *baton,
   child_delete_op_root_relpath,
   wcroot, moved_here_child_relpath,
   iterpool, iterpool));
+#if SVN_DEBUG
+  /* This catches incorrectly recorded moves.
+   * It is possible to hit this during normal operation
+   * if a move was interrupted mid-way so only perform
+   * this check in debug mode. */
+  SVN_ERR_ASSERT(moved_from_relpath 
+ !strcmp(child_moved_from_relpath,
+ svn_sqlite__column_text(stmt, 1, NULL)));
+#endif
   if (child_status == svn_wc__db_status_moved_here)
 {
   const char *child_subtree_relpath;




svn propchange: r1152324 - svn:log

2011-07-29 Thread stsp
Author: stsp
Revision: 1152324
Modified property: svn:log

Modified: svn:log at Fri Jul 29 17:48:58 2011
--
--- svn:log (original)
+++ svn:log Fri Jul 29 17:48:58 2011
@@ -1,4 +1,4 @@
-Restore the changes from r1152293 (which see for log full message),
+Restore the changes from r1152293 (which see for full log message),
 including the following fix:
 
 * subversion/libsvn_wc/wc-queries.sql



svn commit: r1152332 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 18:19:24 2011
New Revision: 1152332

URL: http://svn.apache.org/viewvc?rev=1152332view=rev
Log:
Follow-up to r1152294:

* subversion/libsvn_wc/wc_db.c: Use #ifdef SVN_DEBUG, not #if SVN_DEBUG.
Found by: danielsh

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152332r1=1152331r2=1152332view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 18:19:24 2011
@@ -6136,7 +6136,7 @@ op_delete_txn(void *baton,
   child_delete_op_root_relpath,
   wcroot, moved_here_child_relpath,
   iterpool, iterpool));
-#if SVN_DEBUG
+#ifdef SVN_DEBUG
   /* This catches incorrectly recorded moves.
* It is possible to hit this during normal operation
* if a move was interrupted mid-way so only perform




svn propchange: r1152326 - svn:log

2011-07-29 Thread stsp
Author: stsp
Revision: 1152326
Modified property: svn:log

Modified: svn:log at Fri Jul 29 18:58:06 2011
--
--- svn:log (original)
+++ svn:log Fri Jul 29 18:58:06 2011
@@ -1 +1,2 @@
-Restore r1152294 (which see for full log message) unchanged.
+Restore r1152294 (which see for full log message) unchanged,
+after it was temporarily reverted in r1152300.



svn commit: r1152345 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/info.c libsvn_wc/node.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h tests/libsvn_wc/db-test.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 19:33:13 2011
New Revision: 1152345

URL: http://svn.apache.org/viewvc?rev=1152345view=rev
Log:
Extend svn_wc__db_scan_deletion() to return the moved-to path of
of a moved node, if requested, in MOVED_TO_ABSPATH.

This function already returned the op-root of the copied-half of the move
as MOVED_TO_ABSPATH, but (luckily) none of the callers requested it.
Return this op-root in a new output parameter COPY_OP_ROOT_ABSPATH instead.

Nothing uses the moved-to output parameters yet, so this is no functional
change.

* subversion/libsvn_wc/wc_db.c
  (scan_deletion_baton_t): Add COPY_OP_ROOT_RELPATH.
  (scan_deletion_txn): If the node has been moved-away, compute
   and return the moved-to relpath as well as the the op-root of
   the copied-half of the move.
   Also, do not assert that every node being moved has a BASE.
   This isn't true for sequences like: mv A B; mv B/f B/e;
   In the second move, B/f has no BASE because it is part of the
   copied-half B of the first move.
  (scan_deletion): Add new output parameter COPY_OP_ROOT_RELPATH and
   pass it into the scan_deletion baton.
  (get_info_for_copy, read_url_txn, svn_wc__db_global_relocate): Update
   scan_deletion() callers, passing NULL for COPY_OP_ROOT_RELPATH.
  (svn_wc__db_scan_deletion): Add new output parameter COPY_OP_ROOT_ABSPATH.
   Convert relative paths in moved-to information provided by scan_deletion()
   into absolute paths, and return them.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_scan_deletion): Add COPY_OP_ROOT_ABSPATH parameter and update
   the docstring.

* subversion/libsvn_wc/node.c
  (svn_wc__internal_get_repos_info, svn_wc__node_get_deleted_ancestor,
   svn_wc__internal_get_commit_base_rev, svn_wc__internal_node_get_schedule):
Update callers, passing NULL for COPY_OP_ROOT_ABSPATH.

* subversion/libsvn_wc/entries.c
  (get_info_for_deleted, read_one_entry): Update callers, passing NULL
   for COPY_OP_ROOT_ABSPATH.

* subversion/libsvn_wc/info.c
  (build_info_for_node): Update caller, passing NULL for COPY_OP_ROOT_ABSPATH.

* subversion/tests/libsvn_wc/db-test.c
  (test_scan_deletion): Update callers, passing NULL for COPY_OP_ROOT_ABSPATH.

Modified:
subversion/trunk/subversion/libsvn_wc/entries.c
subversion/trunk/subversion/libsvn_wc/info.c
subversion/trunk/subversion/libsvn_wc/node.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/db-test.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1152345r1=1152344r2=1152345view=diff
==
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Fri Jul 29 19:33:13 2011
@@ -272,7 +272,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
 
  SVN_ERR(svn_wc__db_scan_deletion(NULL,
   NULL,
-  work_del_abspath,
+  work_del_abspath, NULL,
   db, entry_abspath,
   scratch_pool, scratch_pool));
 
@@ -525,7 +525,7 @@ read_one_entry(const svn_wc_entry_t **ne
 {
   const char *work_del_abspath;
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath,
+   work_del_abspath, NULL,
db, entry_abspath,
scratch_pool, scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1152345r1=1152344r2=1152345view=diff
==
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Fri Jul 29 19:33:13 2011
@@ -200,7 +200,7 @@ build_info_for_node(svn_wc__info2_t **in
 
   /* And now fetch the url and revision of what will be deleted */
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath,
+   work_del_abspath, NULL,
db, local_abspath,
scratch_pool, scratch_pool));
   if (work_del_abspath != NULL)

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1152345r1=1152344r2=1152345view=diff
==
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Fri Jul 29 19:33:13

svn commit: r1152348 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/info.c libsvn_wc/node.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h tests/libsvn_wc/db-test.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 19:35:45 2011
New Revision: 1152348

URL: http://svn.apache.org/viewvc?rev=1152348view=rev
Log:
Whoops, revert the just-committed r1152345, it wasn't quite ready yet.

Modified:
subversion/trunk/subversion/libsvn_wc/entries.c
subversion/trunk/subversion/libsvn_wc/info.c
subversion/trunk/subversion/libsvn_wc/node.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/db-test.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1152348r1=1152347r2=1152348view=diff
==
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Fri Jul 29 19:35:45 2011
@@ -272,7 +272,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
 
  SVN_ERR(svn_wc__db_scan_deletion(NULL,
   NULL,
-  work_del_abspath, NULL,
+  work_del_abspath,
   db, entry_abspath,
   scratch_pool, scratch_pool));
 
@@ -525,7 +525,7 @@ read_one_entry(const svn_wc_entry_t **ne
 {
   const char *work_del_abspath;
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath, NULL,
+   work_del_abspath,
db, entry_abspath,
scratch_pool, scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1152348r1=1152347r2=1152348view=diff
==
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Fri Jul 29 19:35:45 2011
@@ -200,7 +200,7 @@ build_info_for_node(svn_wc__info2_t **in
 
   /* And now fetch the url and revision of what will be deleted */
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath, NULL,
+   work_del_abspath,
db, local_abspath,
scratch_pool, scratch_pool));
   if (work_del_abspath != NULL)

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1152348r1=1152347r2=1152348view=diff
==
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Fri Jul 29 19:35:45 2011
@@ -182,7 +182,7 @@ svn_wc__internal_get_repos_info(const ch
   const char *base_del_abspath, *wrk_del_abspath;
 
   SVN_ERR(svn_wc__db_scan_deletion(base_del_abspath, NULL,
-   wrk_del_abspath, NULL,
+   wrk_del_abspath,
db, local_abspath,
scratch_pool, scratch_pool));
 
@@ -768,7 +768,7 @@ svn_wc__node_get_deleted_ancestor(const 
 
   if (status == svn_wc__db_status_deleted)
 SVN_ERR(svn_wc__db_scan_deletion(deleted_ancestor_abspath, NULL, NULL,
- NULL, wc_ctx-db, local_abspath,
+ wc_ctx-db, local_abspath,
  result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -1017,7 +1017,7 @@ svn_wc__internal_get_commit_base_rev(svn
   const char *work_del_abspath;
 
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath, NULL,
+   work_del_abspath,
db, local_abspath,
scratch_pool, scratch_pool));
   if (work_del_abspath != NULL)
@@ -1160,7 +1160,7 @@ svn_wc__internal_node_get_schedule(svn_w
 
   /* Find out details of our deletion.  */
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath, NULL,
+   work_del_abspath,
db, local_abspath,
scratch_pool, scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152348r1=1152347r2=1152348view=diff

svn commit: r1152364 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 20:15:00 2011
New Revision: 1152364

URL: http://svn.apache.org/viewvc?rev=1152364view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): Always initialise local variables MOVED_FROM_RELPATH,
   CHILED_MOVED_FROM_RELPATH, and CHILD_DELETE_OP_ROOT_RELPATH.
   Also test the right variable for non-NULLness in debug assertion.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152364r1=1152363r2=1152364view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 20:15:00 2011
@@ -6070,7 +6070,7 @@ op_delete_txn(void *baton,
 
   if (b-moved_to_relpath)
 {
-  const char *moved_from_relpath;
+  const char *moved_from_relpath = NULL;
 
   /* ### call scan_addition_txn() directly? */
   if (status == svn_wc__db_status_added)
@@ -6113,8 +6113,8 @@ op_delete_txn(void *baton,
   while (have_row)
 {
   svn_wc__db_status_t child_status;
-  const char *child_moved_from_relpath;
-  const char *child_delete_op_root_relpath;
+  const char *child_moved_from_relpath = NULL;
+  const char *child_delete_op_root_relpath = NULL;
   const char *moved_here_child_relpath =
 svn_sqlite__column_text(stmt, 0, scratch_pool);
 
@@ -6141,7 +6141,7 @@ op_delete_txn(void *baton,
* It is possible to hit this during normal operation
* if a move was interrupted mid-way so only perform
* this check in debug mode. */
-  SVN_ERR_ASSERT(moved_from_relpath 
+  SVN_ERR_ASSERT(child_moved_from_relpath 
  !strcmp(child_moved_from_relpath,
  svn_sqlite__column_text(stmt, 1, NULL)));
 #endif




svn commit: r1152368 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-07-29 Thread stsp
Author: stsp
Date: Fri Jul 29 20:36:13 2011
New Revision: 1152368

URL: http://svn.apache.org/viewvc?rev=1152368view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (op_delete_txn): Reset open SQLite statements when returning errors
   that aren't coming from the svn_sqlite__ API.

Found by: rhuijben

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1152368r1=1152367r2=1152368view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jul 29 20:36:13 2011
@@ -6117,25 +6117,34 @@ op_delete_txn(void *baton,
   const char *child_delete_op_root_relpath = NULL;
   const char *moved_here_child_relpath =
 svn_sqlite__column_text(stmt, 0, scratch_pool);
+  svn_error_t *err;
 
   svn_pool_clear(iterpool);
 
   /* The moved-here-children query returns info based on the
* delete-half of the move. Check if that the copied-half of
* the move matches this information. */
-  SVN_ERR(read_info(child_status, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL, NULL, NULL, NULL,
-wcroot, moved_here_child_relpath,
-iterpool, iterpool));
+  err = read_info(child_status, NULL, NULL, NULL, NULL,
+  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+  NULL, NULL, NULL, NULL, NULL, NULL,
+  wcroot, moved_here_child_relpath,
+  iterpool, iterpool);
+  if (err)
+return svn_error_compose_create(err, svn_sqlite__reset(stmt));
+
   if (child_status == svn_wc__db_status_added)
-SVN_ERR(scan_addition(child_status, NULL, NULL, NULL,
+{
+  err = scan_addition(child_status, NULL, NULL, NULL,
   NULL, NULL, NULL,
   child_moved_from_relpath,
   child_delete_op_root_relpath,
   wcroot, moved_here_child_relpath,
-  iterpool, iterpool));
+  iterpool, iterpool);
+  if (err)
+return svn_error_compose_create(err,
+svn_sqlite__reset(stmt));
+}
 #ifdef SVN_DEBUG
   /* This catches incorrectly recorded moves.
* It is possible to hit this during normal operation




svn commit: r1152436 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/info.c libsvn_wc/node.c libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c libsvn_wc/wc_db.h tests/libsvn_wc/db-test.c

2011-07-30 Thread stsp
Author: stsp
Date: Sat Jul 30 09:22:14 2011
New Revision: 1152436

URL: http://svn.apache.org/viewvc?rev=1152436view=rev
Log:
Fixed version of the change originally committed in r1152345 and
reverted again in r1152348:

Extend svn_wc__db_scan_deletion() to return the moved-to path of
of a moved node, if requested, in MOVED_TO_ABSPATH.

This function previously returned the op-root of the copied-half of the
move as MOVED_TO_ABSPATH, but (luckily) none of the callers requested it.
Return the op-root in a new output parameter COPY_OP_ROOT_ABSPATH instead.

* subversion/libsvn_wc/wc_db.c
  (scan_deletion_baton_t): Add COPY_OP_ROOT_RELPATH.
  (scan_deletion_txn): If the node has been moved-away, compute
   and return the moved-to relpath as well as the the op-root of
   the copied-half of the move.
   Also, do not assert that every node being moved has a BASE.
   This isn't true for sequences like: mv A B; mv B/f B/e;
   In the second move, B/f has no BASE because it is part of the
   copied-half B of the first move.
  (scan_deletion): Add new output parameter COPY_OP_ROOT_RELPATH and
   pass it into the scan_deletion baton.
  (get_info_for_copy, read_url_txn, svn_wc__db_global_relocate): Update
   scan_deletion() callers, passing NULL for COPY_OP_ROOT_RELPATH.
  (svn_wc__db_scan_deletion): Add new output parameter COPY_OP_ROOT_ABSPATH.
   Convert relative paths in moved-to information provided by scan_deletion()
   into absolute paths, and return them.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_scan_deletion): Add COPY_OP_ROOT_ABSPATH parameter and update
   the docstring.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_DELETION_INFO): Get moved-to information from the BASE since
   it is stored there as of r1152410.

* subversion/libsvn_wc/node.c
  (svn_wc__internal_get_repos_info, svn_wc__node_get_deleted_ancestor,
   svn_wc__internal_get_commit_base_rev, svn_wc__internal_node_get_schedule):
Update callers, passing NULL for COPY_OP_ROOT_ABSPATH.

* subversion/libsvn_wc/entries.c
  (get_info_for_deleted, read_one_entry): Update callers, passing NULL
   for COPY_OP_ROOT_ABSPATH.

* subversion/libsvn_wc/info.c
  (build_info_for_node): Update caller, passing NULL for COPY_OP_ROOT_ABSPATH.

* subversion/tests/libsvn_wc/db-test.c
  (TESTING_DATA): Put moved-to data into BASE layer. Add some missing
   move-target nodes that are needed by scan_deletion() to properly resolve
   moved-to information.
  (test_scan_deletion): Update callers, verify COPY_OP_ROOT_ABSPATH where
   a move is being resolved, else pass NULL for COPY_OP_ROOT_ABSPATH.

Modified:
subversion/trunk/subversion/libsvn_wc/entries.c
subversion/trunk/subversion/libsvn_wc/info.c
subversion/trunk/subversion/libsvn_wc/node.c
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/db-test.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1152436r1=1152435r2=1152436view=diff
==
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Sat Jul 30 09:22:14 2011
@@ -272,7 +272,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
 
  SVN_ERR(svn_wc__db_scan_deletion(NULL,
   NULL,
-  work_del_abspath,
+  work_del_abspath, NULL,
   db, entry_abspath,
   scratch_pool, scratch_pool));
 
@@ -525,7 +525,7 @@ read_one_entry(const svn_wc_entry_t **ne
 {
   const char *work_del_abspath;
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath,
+   work_del_abspath, NULL,
db, entry_abspath,
scratch_pool, scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1152436r1=1152435r2=1152436view=diff
==
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Sat Jul 30 09:22:14 2011
@@ -200,7 +200,7 @@ build_info_for_node(svn_wc__info2_t **in
 
   /* And now fetch the url and revision of what will be deleted */
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath,
+   work_del_abspath, NULL,
db, local_abspath

svn propchange: r1152345 - svn:log

2011-07-30 Thread stsp
Author: stsp
Revision: 1152345
Modified property: svn:log

Modified: svn:log at Sat Jul 30 09:24:16 2011
--
--- svn:log (original)
+++ svn:log Sat Jul 30 09:24:16 2011
@@ -1,3 +1,6 @@
+[ Note from the future: This change wasn't actually ready for commit yet.
+  It was reverted in r1152348, and a fixed version was committed in r1152436. ]
+
 Extend svn_wc__db_scan_deletion() to return the moved-to path of
 of a moved node, if requested, in MOVED_TO_ABSPATH.
 



svn commit: r1152447 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/node.c

2011-07-30 Thread stsp
Author: stsp
Date: Sat Jul 30 10:47:39 2011
New Revision: 1152447

URL: http://svn.apache.org/viewvc?rev=1152447view=rev
Log:
Add a new libsvn_wc API function: svn_wc__node_was_moved_away().

* subversion/include/private/svn_wc_private.h
   (svn_wc__node_was_moved_away): Declare.

* subversion/libsvn_wc/node.c
   (svn_wc__node_was_moved_away): New. Provides the MOVED_TO_ABSPATH of
a node that was moved-away, as well the COPY_OP_ROOT_ABSPATH of the
copy-half of the move.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_wc/node.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1152447r1=1152446r2=1152447view=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Sat Jul 30 
10:47:39 2011
@@ -1127,6 +1127,24 @@ svn_wc__delete_internal(svn_wc_context_t
 void *notify_baton,
 apr_pool_t *scratch_pool);
 
+/* If the node at LOCAL_ABSPATH was moved away set *MOVED_TO_ABSPATH to
+ * the absolute path of the copied move-target node, and *COPY_OP_ROOT_ABSPATH
+ * to the absolute path of the root node of the copy operation.
+ *
+ * If the node was not moved, set *MOVED_TO_ABSPATH and *COPY_OP_ROOT_ABSPATH
+ * to NULL.
+ *
+ * Either MOVED_TO_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
+ * that the caller is not interested in the result.
+ */
+svn_error_t *
+svn_wc__node_was_moved_away(const char **moved_to_abspath,
+const char **copy_op_root_abspath,
+svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+apr_pool_t *result_pool,
+apr_pool_t *scratch_pool);
+
 /* If the node at LOCAL_ABSPATH was moved here set *MOVED_FROM_ABSPATH to
  * the absolute path of the deleted move-source node, and set
  * *DELETE_OP_ROOT_ABSPATH to the absolute path of the root node of the

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1152447r1=1152446r2=1152447view=diff
==
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Sat Jul 30 10:47:39 2011
@@ -1795,6 +1795,33 @@ svn_wc__check_for_obstructions(svn_wc_no
 
 
 svn_error_t *
+svn_wc__node_was_moved_away(const char **moved_to_abspath,
+const char **op_root_abspath,
+svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+apr_pool_t *result_pool,
+apr_pool_t *scratch_pool)
+{
+  svn_boolean_t is_deleted;
+
+  if (moved_to_abspath)
+*moved_to_abspath = NULL;
+  if (op_root_abspath)
+*op_root_abspath = NULL;
+
+  SVN_ERR(svn_wc__node_is_status_deleted(is_deleted, wc_ctx, local_abspath,
+ scratch_pool));
+  if (is_deleted)
+SVN_ERR(svn_wc__db_scan_deletion(NULL, moved_to_abspath, NULL,
+ op_root_abspath, wc_ctx-db,
+ local_abspath,
+ result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
 svn_wc__node_was_moved_here(const char **moved_from_abspath,
 const char **delete_op_root_abspath,
 svn_wc_context_t *wc_ctx,




svn commit: r1152449 - in /subversion/trunk/subversion: libsvn_client/commit.c tests/cmdline/copy_tests.py

2011-07-30 Thread stsp
Author: stsp
Date: Sat Jul 30 10:52:20 2011
New Revision: 1152449

URL: http://svn.apache.org/viewvc?rev=1152449view=rev
Log:
Make commit refuse to commit the delete-half of a move separately from
the copied-half.

* subversion/libsvn_client/commit.c
  (svn_client_commit5): If a deleted commit target was moved-away
   refuse to perform the commit unless the copied-half of the move
   is among the commit targets.

* subversion/tests/cmdline/copy_tests.py
  (commit_deleted_half_of_move): Remove XFail marker.

Modified:
subversion/trunk/subversion/libsvn_client/commit.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=1152449r1=1152448r2=1152449view=diff
==
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Sat Jul 30 10:52:20 2011
@@ -1447,7 +1447,35 @@ svn_client_commit5(const apr_array_heade
 }
 }
 }
-  /* ### TODO: check the delete-half, too */
+  else if (item-state_flags  SVN_CLIENT_COMMIT_ITEM_DELETE)
+{
+  const char *moved_to_abspath;
+  const char *copy_op_root_abspath;
+
+  cmt_err = svn_error_trace(svn_wc__node_was_moved_away(
+  moved_to_abspath,
+  copy_op_root_abspath,
+  ctx-wc_ctx, item-path,
+  iterpool, iterpool));
+  if (cmt_err)
+goto cleanup;
+
+  if (moved_to_abspath  copy_op_root_abspath 
+  strcmp(moved_to_abspath, copy_op_root_abspath) == 0 
+  apr_hash_get(committables-by_path, copy_op_root_abspath,
+   APR_HASH_KEY_STRING) == NULL)
+{
+  cmt_err = svn_error_createf(
+  SVN_ERR_ILLEGAL_TARGET, NULL,
+ _(Cannot commit '%s' because it was moved to '%s' 
+   which is not part of the commit; both sides of 
+   the move must be committed together),
+ svn_dirent_local_style(item-path, iterpool),
+ svn_dirent_local_style(copy_op_root_abspath,
+iterpool));
+  goto cleanup;
+}
+}
 }
 
   /* Go get a log message.  If an error occurs, or no log message is

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1152449r1=1152448r2=1152449view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Sat Jul 30 10:52:20 
2011
@@ -5526,7 +5526,6 @@ def commit_copied_half_of_nested_move(sb
 
 
 @Issue(3631)
-@XFail()
 def commit_deleted_half_of_move(sbox):
   attempt to commit the deleted part of move
   sbox.build(read_only = True)




svn commit: r1154908 - /subversion/trunk/subversion/bindings/swig/ruby/test/util.rb

2011-08-08 Thread stsp
Author: stsp
Date: Mon Aug  8 10:32:54 2011
New Revision: 1154908

URL: http://svn.apache.org/viewvc?rev=1154908view=rev
Log:
* subversion/bindings/swig/ruby/test/util.rb
  (setup_svnserve): Wait more time for svnserve to gets its marbles together.
I've started getting spurious test failures in the ruby bindings again
because of 'connection refused to 127.0.0.1' errors. I've tried various
increments (0.2, 0.5, 1), and waiting for an entire second seemed to be
the only way of producing solid results. This increases run time of
the ruby tests quite a bit. But it is still dwarfed by the overall run
time of the test suite so I hope this is acceptable.

Modified:
subversion/trunk/subversion/bindings/swig/ruby/test/util.rb

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/util.rb
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/util.rb?rev=1154908r1=1154907r2=1154908view=diff
==
--- subversion/trunk/subversion/bindings/swig/ruby/test/util.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/util.rb Mon Aug  8 
10:32:54 2011
@@ -262,7 +262,7 @@ realm = #{@realm}
 svn://#{@svnserve_host}:#{@svnserve_port}#{@full_repos_path}
   # Avoid a race by waiting a short time for svnserve to start up.
   # Without this, tests can fail with Connection refused errors.
-  sleep 0.1
+  sleep 1
   break
 end
   end




svn commit: r1154909 - /subversion/branches/1.7.x/STATUS

2011-08-08 Thread stsp
Author: stsp
Date: Mon Aug  8 10:34:58 2011
New Revision: 1154909

URL: http://svn.apache.org/viewvc?rev=1154909view=rev
Log:
* STATUS: Nominate r1154908.

Modified:
subversion/branches/1.7.x/STATUS

Modified: subversion/branches/1.7.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1154909r1=1154908r2=1154909view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Mon Aug  8 10:34:58 2011
@@ -135,6 +135,14 @@ Candidate changes:
Votes:
  +1: rhuijben
 
+ * r1154908
+   Fix spurious test failures in Ruby bindings.
+   Justification:
+ Spurious test failures are a huge distraction and time sink when
+ signing releases.
+   Votes:
+ +1: stsp
+
 Veto-blocked changes:
 =
 




svn commit: r1154913 - /subversion/trunk/tools/dev/unix-build/Makefile.svn

2011-08-08 Thread stsp
Author: stsp
Date: Mon Aug  8 10:50:16 2011
New Revision: 1154913

URL: http://svn.apache.org/viewvc?rev=1154913view=rev
Log:
* tools/dev/unix-build/Makefile.svn
  (svn-check-swig-rb): Do not reproduce code from Subversion's own Makefile
   here. Run the provided 'check-swig-rb' target instead.

Modified:
subversion/trunk/tools/dev/unix-build/Makefile.svn

Modified: subversion/trunk/tools/dev/unix-build/Makefile.svn
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/dev/unix-build/Makefile.svn?rev=1154913r1=1154912r2=1154913view=diff
==
--- subversion/trunk/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/trunk/tools/dev/unix-build/Makefile.svn Mon Aug  8 10:50:16 2011
@@ -1448,12 +1448,11 @@ svn-check-swig-py:
 # We add the svn prefix to PATH here because the ruby tests
 # attempt to start an svnserve binary found in PATH.
 svn-check-swig-rb:
-   (cd $(svn_builddir)/subversion/bindings/swig/ruby/test  \
+   (cd $(svn_builddir)  \
env RUBYLIB=$(RUBYLIB) \
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
PATH=$(SVN_PREFIX)/bin:$$PATH \
-   $(PREFIX)/ruby/bin/ruby run-test.rb \
-   --verbose=verbose 21) | \
+   make check-swig-rb 21) | \
tee $(svn_builddir)/tests.log.bindings.rb
 
 svn-check-javahl:




svn commit: r1154938 - /subversion/trunk/subversion/tests/cmdline/copy_tests.py

2011-08-08 Thread stsp
Author: stsp
Date: Mon Aug  8 12:11:06 2011
New Revision: 1154938

URL: http://svn.apache.org/viewvc?rev=1154938view=rev
Log:
* subversion/tests/cmdline/copy_tests.py
  (commit_copied_half_of_move, commit_deleted_half_of_move): Verify moved-to
   and moved-from paths shown in error messages.

Modified:
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1154938r1=1154937r2=1154938view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Mon Aug  8 12:11:06 
2011
@@ -5482,7 +5482,9 @@ def commit_copied_half_of_move(sbox):
 
   svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
 
-  expected_error = svn: E29: Cannot commit
+  expected_error = svn: E29: Cannot commit '.*%s' because it was moved  \
+from '.*%s' % (re.escape(os.path.join(D_path, iota)),
+ re.escape(iota_path))
   svntest.actions.run_and_verify_svn(None, None, expected_error,
  'commit', '-m', 'foo', D_path)
 
@@ -5536,7 +5538,9 @@ def commit_deleted_half_of_move(sbox):
 
   svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
 
-  expected_error = svn: E29: Cannot commit
+  expected_error = svn: E29: Cannot commit '.*%s' because it was moved  \
+to '.*%s' % (re.escape(iota_path),
+   re.escape(os.path.join(D_path, iota)))
   svntest.actions.run_and_verify_svn(None, None, expected_error,
  'commit', '-m', 'foo', iota_path)
 




svn commit: r1154946 - /subversion/trunk/subversion/tests/cmdline/copy_tests.py

2011-08-08 Thread stsp
Author: stsp
Date: Mon Aug  8 12:54:28 2011
New Revision: 1154946

URL: http://svn.apache.org/viewvc?rev=1154946view=rev
Log:
Merge two copy tests which were partly overlapping.

* subversion/tests/cmdline/copy_tests.py
  (commit_copied_half_of_nested_move): Remove, and merge into ...
  (commit_copied_half_of_move): ... this function.

Modified:
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1154946r1=1154945r2=1154946view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Mon Aug  8 12:54:28 
2011
@@ -5477,32 +5477,23 @@ def commit_copied_half_of_move(sbox):
   sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
-  iota_path = os.path.join(wc_dir, 'iota')
-  D_path = os.path.join(wc_dir, 'A', 'D')
-
-  svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
-
-  expected_error = svn: E29: Cannot commit '.*%s' because it was moved  \
-from '.*%s' % (re.escape(os.path.join(D_path, iota)),
- re.escape(iota_path))
-  svntest.actions.run_and_verify_svn(None, None, expected_error,
- 'commit', '-m', 'foo', D_path)
-
-@Issue(3631)
-def commit_copied_half_of_nested_move(sbox):
-  attempt to commit the copied part of a nested move
-  sbox.build(read_only = True)
-  wc_dir = sbox.wc_dir
-
   iota_path = sbox.ospath('iota')
   D_path = sbox.ospath('A/D')
 
-  # iota - A/D/iota; verify we cannot commit just A/D
+  # iota - A/D/iota; verify we cannot commit just A/D/iota
   svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
   expected_error = svn: E29: Cannot commit '.*%s' because it was  \
 moved from '.*%s' % (re.escape(sbox.ospath('A/D/iota')),
re.escape(iota_path))
   svntest.actions.run_and_verify_svn(None, None, expected_error,
+ 'commit', '-m', 'foo',
+ os.path.join(D_path, 'iota'))
+
+  # verify we cannot commit just A/D
+  expected_error = svn: E29: Cannot commit '.*%s' because it was  \
+moved from '.*%s' % (re.escape(sbox.ospath('A/D/iota')),
+   re.escape(iota_path))
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
  'commit', '-m', 'foo', D_path)
 
   # A/D - A/C/D; verify we cannot commit just A/C
@@ -5655,7 +5646,6 @@ test_list = [ None,
   copy_and_move_conflicts,
   copy_deleted_dir,
   commit_copied_half_of_move,
-  commit_copied_half_of_nested_move,
   commit_deleted_half_of_move,
  ]
 




svn commit: r1154948 - /subversion/trunk/subversion/tests/cmdline/copy_tests.py

2011-08-08 Thread stsp
Author: stsp
Date: Mon Aug  8 13:05:37 2011
New Revision: 1154948

URL: http://svn.apache.org/viewvc?rev=1154948view=rev
Log:
* subversion/tests/cmdline/copy_tests.py
  (commit_deleted_half_of_move): Cover the case where the delete-half of
   a move is picked up via recursion. Use sbox.ospath() where possible.

Modified:
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1154948r1=1154947r2=1154948view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Mon Aug  8 13:05:37 
2011
@@ -5524,9 +5524,11 @@ def commit_deleted_half_of_move(sbox):
   sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
-  iota_path = os.path.join(wc_dir, 'iota')
-  D_path = os.path.join(wc_dir, 'A', 'D')
+  iota_path = sbox.ospath('iota')
+  A_path = sbox.ospath('A')
+  D_path = sbox.ospath('A/D')
 
+  # iota - A/D/iota; verify we cannot commit just iota
   svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
 
   expected_error = svn: E29: Cannot commit '.*%s' because it was moved  \
@@ -5535,6 +5537,15 @@ def commit_deleted_half_of_move(sbox):
   svntest.actions.run_and_verify_svn(None, None, expected_error,
  'commit', '-m', 'foo', iota_path)
 
+  # A/D - C; verify we cannot commit just A
+  C_path = sbox.ospath('C')
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_path, C_path)
+  expected_error = svn: E29: Cannot commit '.*%s' because it was moved  \
+to '.*%s' % (re.escape(D_path), re.escape(C_path))
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+ 'commit', '-m', 'foo', A_path)
+
 
 # Run the tests
 




svn commit: r1155000 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2011-08-08 Thread stsp
Author: stsp
Date: Mon Aug  8 16:02:41 2011
New Revision: 1155000

URL: http://svn.apache.org/viewvc?rev=1155000view=rev
Log:
Fix problems getting moved-from information from svn_wc__db_scan_addition().

* subversion/libsvn_wc/wc_db.c
  (get_moved_from_info): Allow the STATUS output parameter to be NULL.
  (scan_addition_txn): Fix bug: moved-from info was only returned if the
   caller passed a non-NULL STATUS parameter in addition to the
   MOVED_FROM_RELPATH and DELETE_OP_ROOT_RELPATH output parameters.
   Add a note saying that a rather large if-statement in this function
   should be refactored.
  (svn_wc__db_scan_addition): If the node is not moved, set *MOVED_FROM_ABSPATH
   and *DELETE_OP_ROOT_ABSPATH to NULL as promised by docstring.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1155000r1=1154999r2=1155000view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Aug  8 16:02:41 2011
@@ -9102,7 +9102,8 @@ svn_wc__db_scan_base_repos(const char **
 /* A helper for scan_addition().
  * Compute moved-from information for the node at LOCAL_RELPATH which
  * has been determined as having been moved-here.
- * Return an appropriate status in *STATUS (usually moved-here).
+ * If STATUS is not NULL, return an appropriate status in *STATUS (usually
+ * moved-here).
  * If MOVED_FROM_RELPATH is not NULL, set *MOVED_FROM_RELPATH to the
  * path of the move-source node in *MOVED_FROM_RELPATH.
  * If DELETE_OP_ROOT_RELPATH is not NULL, set *DELETE_OP_ROOT_RELPATH
@@ -9135,7 +9136,8 @@ get_moved_from_info(svn_wc__db_status_t 
   /* The move was only recorded at the copy-half, possibly because
* the move operation was interrupted mid-way between the copy
* and the delete. Treat this node as a normal copy. */
-  *status = svn_wc__db_status_copied;
+  if (status)
+*status = svn_wc__db_status_copied;
   if (moved_from_relpath)
 *moved_from_relpath = NULL;
   if (delete_op_root_relpath)
@@ -9146,7 +9148,8 @@ get_moved_from_info(svn_wc__db_status_t 
 }
 
   /* It's a properly recorded move. */
-  *status = svn_wc__db_status_moved_here;
+  if (status)
+*status = svn_wc__db_status_moved_here;
 
   if (moved_from_relpath || delete_op_root_relpath)
 {
@@ -9303,11 +9306,16 @@ scan_addition_txn(void *baton,
 if (sab-op_root_relpath)
   *sab-op_root_relpath = apr_pstrdup(sab-result_pool, op_root_relpath);
 
+/* ### This if-statement is quite redundant.
+ * ### We're checking all these values again within the body anyway.
+ * ### The body should be broken up appropriately and move into the
+ * ### outer scope. */
 if (sab-original_repos_relpath
 || sab-original_repos_id
 || (sab-original_revision
  *sab-original_revision == SVN_INVALID_REVNUM)
-|| sab-status)
+|| sab-status
+|| sab-moved_from_relpath || sab-delete_op_root_relpath)
   {
 if (local_relpath != op_root_relpath)
   /* requery to get the add/copy root */
@@ -9342,14 +9350,16 @@ scan_addition_txn(void *baton,
 
 if (!svn_sqlite__column_is_null(stmt, 10)
  (sab-status
-|| sab-original_repos_id))
+|| sab-original_repos_id
+|| sab-moved_from_relpath || sab-delete_op_root_relpath))
   /* If column 10 (original_repos_id) is NULL,
  this is a plain add, not a copy or a move */
   {
 if (sab-original_repos_id)
   *sab-original_repos_id = svn_sqlite__column_int64(stmt, 10);
 
-if (sab-status)
+if (sab-status ||
+sab-moved_from_relpath || sab-delete_op_root_relpath)
   {
 if (svn_sqlite__column_boolean(stmt, 13 /* moved_here */))
   SVN_ERR(get_moved_from_info(sab-status,
@@ -9359,7 +9369,7 @@ scan_addition_txn(void *baton,
   local_relpath,
   sab-result_pool,
   scratch_pool));
-else
+else if (sab-status)
   *sab-status = svn_wc__db_status_copied;
   }
   }
@@ -9553,14 +9563,26 @@ svn_wc__db_scan_addition(svn_wc__db_stat
wcroot-sdb, original_repos_id,
result_pool));
 
-  if (moved_from_abspath  moved_from_relpath)
-*moved_from_abspath = svn_dirent_join(wcroot-abspath,
-  moved_from_relpath,
-  result_pool);
-  if (delete_op_root_abspath  delete_op_root_relpath

svn commit: r1155001 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/info.c svn/info-cmd.c svn/schema/info.rnc

2011-08-08 Thread stsp
Author: stsp
Date: Mon Aug  8 16:05:24 2011
New Revision: 1155001

URL: http://svn.apache.org/viewvc?rev=1155001view=rev
Log:
Show moved-to/moved-from information in 'svn info' output.

* subversion/include/svn_wc.h
  (svn_wc_info_t): New fields MOVED_FROM_RELPATH and MOVED_TO_RELPATH.

* subversion/svn/info-cmd.c
  (print_info_xml, print_info): Show move information in wc info, if any.

* subversion/svn/schema/info.rnc
  (wc-info): Add moved-from and moved-to tags.

* subversion/libsvn_wc/info.c
  (svn_wc_info_dup): Dup the new fields.
  (build_info_for_node): Obtain move information from DB and put it into
   the returned wc-info structure.

Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_wc/info.c
subversion/trunk/subversion/svn/info-cmd.c
subversion/trunk/subversion/svn/schema/info.rnc

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1155001r1=1155000r2=1155001view=diff
==
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Mon Aug  8 16:05:24 2011
@@ -3068,6 +3068,15 @@ typedef struct svn_wc_info_t
   /** The local absolute path of the working copy root.  */
   const char *wcroot_abspath;
 
+  /** The path the node was moved from, if it was moved here. Else NULL.
+   * This path is relative to the working copy root.
+   * @since New in 1.8. */
+  const char *moved_from_relpath;
+
+  /** The path the node was moved to, if it was moved away. Else NULL.
+   * This path is relative to the working copy root.
+   * @since New in 1.8. */
+  const char *moved_to_relpath;
 } svn_wc_info_t;
 
 /**

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1155001r1=1155000r2=1155001view=diff
==
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Mon Aug  8 16:05:24 2011
@@ -63,6 +63,11 @@ svn_wc_info_dup(const svn_wc_info_t *inf
 new_info-copyfrom_url = apr_pstrdup(pool, info-copyfrom_url);
   if (info-wcroot_abspath)
 new_info-wcroot_abspath = apr_pstrdup(pool, info-wcroot_abspath);
+  if (info-moved_from_relpath)
+new_info-moved_from_relpath = apr_pstrdup(pool, info-moved_from_relpath);
+  if (info-moved_to_relpath)
+new_info-moved_to_relpath = apr_pstrdup(pool, info-moved_to_relpath);
+
   return new_info;
 }
 
@@ -133,6 +138,8 @@ build_info_for_node(svn_wc__info2_t **in
 
   if (original_repos_relpath)
 {
+  const char *moved_from_abspath;
+
   /* Root or child of copy */
   tmpinfo-rev = original_revision;
   repos_relpath = original_repos_relpath;
@@ -146,6 +153,26 @@ build_info_for_node(svn_wc__info2_t **in
 
   wc_info-copyfrom_rev = original_revision;
 }
+
+  SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL,
+   moved_from_abspath, NULL,
+   db, local_abspath,
+   result_pool, scratch_pool));
+  if (moved_from_abspath)
+{
+  const char *wcroot_abspath;
+  const char *relpath;
+
+  SVN_ERR(svn_wc__db_get_wcroot(wcroot_abspath, db, local_abspath,
+scratch_pool, scratch_pool));
+  relpath = svn_dirent_skip_ancestor(wcroot_abspath,
+ moved_from_abspath);
+  wc_info-moved_from_relpath = apr_pstrdup(result_pool,
+relpath);
+}
+  else
+wc_info-moved_from_relpath = NULL;
 }
   else if (op_root)
 {
@@ -187,6 +214,7 @@ build_info_for_node(svn_wc__info2_t **in
   else if (status == svn_wc__db_status_deleted)
 {
   const char *work_del_abspath;
+  const char *moved_to_abspath;
 
   SVN_ERR(svn_wc__db_read_pristine_info(NULL, NULL,
 tmpinfo-last_changed_rev,
@@ -199,7 +227,7 @@ build_info_for_node(svn_wc__info2_t **in
 result_pool, scratch_pool));
 
   /* And now fetch the url and revision of what will be deleted */
-  SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
+  SVN_ERR(svn_wc__db_scan_deletion(NULL, moved_to_abspath,
work_del_abspath, NULL,
db, local_abspath,
scratch_pool, scratch_pool));
@@ -242,6 +270,19 @@ build_info_for_node

svn commit: r1155279 - /subversion/trunk/subversion/libsvn_client/diff.c

2011-08-09 Thread stsp
Author: stsp
Date: Tue Aug  9 09:22:24 2011
New Revision: 1155279

URL: http://svn.apache.org/viewvc?rev=1155279view=rev
Log:
Include the copyfrom revision provided to the file_added() diff callback
in git diff copied headers.

For now this is a no-op because the file_added() callback doesn't seem
to ever receive a copyfrom revision. Maybe because of issue #3711?
It does receive a copyfrom path though so maybe this is just a bug?

* subversion/libsvn_client/diff.c
  (print_git_diff_header_copied, print_git_diff_header,
   diff_content_changed): Add COPYFROM_REV argument and show it if it
   is a valid revision number.
  (display_prop_diffs, diff_file_changed, diff_file_added,
   diff_file_deleted): Update callers, passing SVN_INVALID_REVNUM as
the copyfrom revision in most cases.

Modified:
subversion/trunk/subversion/libsvn_client/diff.c

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1155279r1=1155278r2=1155279view=diff
==
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Tue Aug  9 09:22:24 2011
@@ -400,15 +400,22 @@ print_git_diff_header_deleted(svn_stream
  * OS using HEADER_ENCODING. All allocations are done in RESULT_POOL. */
 static svn_error_t *
 print_git_diff_header_copied(svn_stream_t *os, const char *header_encoding,
- const char *copyfrom_path, const char *path,
+ const char *copyfrom_path,
+ svn_revnum_t copyfrom_rev,
+ const char *path,
  apr_pool_t *result_pool)
 {
   SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
   diff --git a/%s b/%s%s,
   copyfrom_path, path, APR_EOL_STR));
-  SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
-  copy from %s%s, copyfrom_path,
-  APR_EOL_STR));
+  if (copyfrom_rev != SVN_INVALID_REVNUM)
+SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+copy from %s@%ld%s, copyfrom_path,
+copyfrom_rev, APR_EOL_STR));
+  else
+SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+copy from %s%s, copyfrom_path,
+APR_EOL_STR));
   SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
   copy to %s%s, path, APR_EOL_STR));
   return SVN_NO_ERROR;
@@ -450,9 +457,10 @@ print_git_diff_header_modified(svn_strea
  * HEADER_ENCODING. Return suitable diff labels for the git diff in *LABEL1
  * and *LABEL2. REPOS_RELPATH1 and REPOS_RELPATH2 are relative to reposroot.
  * are the paths passed to the original diff command. REV1 and REV2 are
- * revisions being diffed. COPYFROM_PATH indicates where the diffed item
- * was copied from. RA_SESSION and WC_CTX are used to adjust paths in the
- * headers to be relative to the repository root.
+ * revisions being diffed. COPYFROM_PATH and COPYFROM_REV indicate where the
+ * diffed item was copied from.
+ * RA_SESSION and WC_CTX are used to adjust paths in the headers to be
+ * relative to the repository root.
  * WC_ROOT_ABSPATH is the absolute path to the root directory of a working
  * copy involved in a repos-wc diff, and may be NULL.
  * Use SCRATCH_POOL for temporary allocations. */
@@ -465,6 +473,7 @@ print_git_diff_header(svn_stream_t *os,
   svn_revnum_t rev1,
   svn_revnum_t rev2,
   const char *copyfrom_path,
+  svn_revnum_t copyfrom_rev,
   const char *header_encoding,
   svn_ra_session_t *ra_session,
   svn_wc_context_t *wc_ctx,
@@ -484,7 +493,8 @@ print_git_diff_header(svn_stream_t *os,
   else if (operation == svn_diff_op_copied)
 {
   SVN_ERR(print_git_diff_header_copied(os, header_encoding,
-   copyfrom_path, repos_relpath2,
+   copyfrom_path, copyfrom_rev,
+   repos_relpath2,
scratch_pool));
   *label1 = diff_label(apr_psprintf(scratch_pool, a/%s, copyfrom_path),
rev1, scratch_pool);
@@ -605,6 +615,7 @@ display_prop_diffs(const apr_array_heade
   SVN_ERR(print_git_diff_header(os, label1, label2,
 svn_diff_op_modified,
 path1, path2, rev1, rev2, NULL

svn commit: r1156434 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/info.c svn/info-cmd.c

2011-08-10 Thread stsp
Author: stsp
Date: Thu Aug 11 01:35:42 2011
New Revision: 1156434

URL: http://svn.apache.org/viewvc?rev=1156434view=rev
Log:
Use absolute paths for moved-from and moved-to in the svn_wc_info_t struct.

Suggested by: rhuijben

* subversion/include/svn_wc.h
  (svn_wc_info_t): Rename MOVED_FROM_RELPATH and MOVED_TO_RELPATH to
   MOVED_FROM_ABSPATH and MOVED_TO_ABSPATH.

* subversion/svn/info-cmd.c
  (print_info_xml, print_info): Convert moved-from/moved-to absolute paths
   to relative paths for display. Fall back to showing absolute paths if
   conversion to relative paths fails.

* subversion/libsvn_wc/info.c
  (svn_wc_info_dup, build_info_for_node): Track struct member renames and
   do not convert absolute moved-from/moved-to paths to relative paths
   before putting them into wc-info.

Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_wc/info.c
subversion/trunk/subversion/svn/info-cmd.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1156434r1=1156433r2=1156434view=diff
==
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Thu Aug 11 01:35:42 2011
@@ -3069,14 +3069,12 @@ typedef struct svn_wc_info_t
   const char *wcroot_abspath;
 
   /** The path the node was moved from, if it was moved here. Else NULL.
-   * This path is relative to the working copy root.
* @since New in 1.8. */
-  const char *moved_from_relpath;
+  const char *moved_from_abspath;
 
   /** The path the node was moved to, if it was moved away. Else NULL.
-   * This path is relative to the working copy root.
* @since New in 1.8. */
-  const char *moved_to_relpath;
+  const char *moved_to_abspath;
 } svn_wc_info_t;
 
 /**

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1156434r1=1156433r2=1156434view=diff
==
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Thu Aug 11 01:35:42 2011
@@ -63,10 +63,10 @@ svn_wc_info_dup(const svn_wc_info_t *inf
 new_info-copyfrom_url = apr_pstrdup(pool, info-copyfrom_url);
   if (info-wcroot_abspath)
 new_info-wcroot_abspath = apr_pstrdup(pool, info-wcroot_abspath);
-  if (info-moved_from_relpath)
-new_info-moved_from_relpath = apr_pstrdup(pool, info-moved_from_relpath);
-  if (info-moved_to_relpath)
-new_info-moved_to_relpath = apr_pstrdup(pool, info-moved_to_relpath);
+  if (info-moved_from_abspath)
+new_info-moved_from_abspath = apr_pstrdup(pool, info-moved_from_abspath);
+  if (info-moved_to_abspath)
+new_info-moved_to_abspath = apr_pstrdup(pool, info-moved_to_abspath);
 
   return new_info;
 }
@@ -138,8 +138,6 @@ build_info_for_node(svn_wc__info2_t **in
 
   if (original_repos_relpath)
 {
-  const char *moved_from_abspath;
-
   /* Root or child of copy */
   tmpinfo-rev = original_revision;
   repos_relpath = original_repos_relpath;
@@ -156,23 +154,9 @@ build_info_for_node(svn_wc__info2_t **in
 
   SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL,
-   moved_from_abspath, NULL,
+   wc_info-moved_from_abspath, NULL,
db, local_abspath,
result_pool, scratch_pool));
-  if (moved_from_abspath)
-{
-  const char *wcroot_abspath;
-  const char *relpath;
-
-  SVN_ERR(svn_wc__db_get_wcroot(wcroot_abspath, db, local_abspath,
-scratch_pool, scratch_pool));
-  relpath = svn_dirent_skip_ancestor(wcroot_abspath,
- moved_from_abspath);
-  wc_info-moved_from_relpath = apr_pstrdup(result_pool,
-relpath);
-}
-  else
-wc_info-moved_from_relpath = NULL;
 }
   else if (op_root)
 {
@@ -214,7 +198,6 @@ build_info_for_node(svn_wc__info2_t **in
   else if (status == svn_wc__db_status_deleted)
 {
   const char *work_del_abspath;
-  const char *moved_to_abspath;
 
   SVN_ERR(svn_wc__db_read_pristine_info(NULL, NULL,
 tmpinfo-last_changed_rev,
@@ -227,7 +210,7 @@ build_info_for_node(svn_wc__info2_t **in
 result_pool, scratch_pool));
 
   /* And now fetch the url and revision of what will be deleted */
-  SVN_ERR

svn commit: r1156691 - /subversion/branches/1.7.x/STATUS

2011-08-11 Thread stsp
Author: stsp
Date: Thu Aug 11 17:24:52 2011
New Revision: 1156691

URL: http://svn.apache.org/viewvc?rev=1156691view=rev
Log:
* STATUS: Vote for r1156527.

Modified:
subversion/branches/1.7.x/STATUS

Modified: subversion/branches/1.7.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1156691r1=1156690r2=1156691view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Thu Aug 11 17:24:52 2011
@@ -193,6 +193,7 @@ Candidate changes:
  Impossible to disable libmagic otherwise.
Votes:
  +0: danielsh
+ +1: stsp
 
 Veto-blocked changes:
 =




svn commit: r1157172 - in /subversion/trunk/subversion: libsvn_client/revert.c tests/cmdline/copy_tests.py

2011-08-12 Thread stsp
Author: stsp
Date: Fri Aug 12 16:05:15 2011
New Revision: 1157172

URL: http://svn.apache.org/viewvc?rev=1157172view=rev
Log:
Make 'svn revert' error out if only one side of a move is reverted.

For now, 'revert' and always refuses to incompletely revert a move.
This will later be extended so that both sides of a move are reverted
if no other local mods affect the moved nodes.

* subversion/libsvn_client/revert.c
  (path_is_in_target_list): New helper. Figures out of a given node is
   within the revert target list.
  (check_moves): New helper. Checks for moved-away and moved-here nodes
   within the to-be-reverted subtree, and throws an error if only one half
   of a move is present.
  (svn_client_revert2): Run check_moves() if we're not reverting the entire WC.

* subversion/tests/cmdline/copy_tests.py
  (mv_and_revert_directory): Revert both sides of move to avoid test failure.

Modified:
subversion/trunk/subversion/libsvn_client/revert.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/libsvn_client/revert.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/revert.c?rev=1157172r1=1157171r2=1157172view=diff
==
--- subversion/trunk/subversion/libsvn_client/revert.c (original)
+++ subversion/trunk/subversion/libsvn_client/revert.c Fri Aug 12 16:05:15 2011
@@ -109,6 +109,124 @@ revert(void *baton, apr_pool_t *result_p
   return SVN_NO_ERROR;
 }
 
+/* Set *IS_IN_TARGET_LIST to TRUE if LOCAL_ABSPATH is an element
+ * or a child of an element in TARGET_LIST. Else return FALSE. */
+static svn_error_t *
+path_is_in_target_list(svn_boolean_t *is_in_target_list,
+   const char *local_abspath,
+   const apr_array_header_t *target_list,
+   apr_pool_t *scratch_pool)
+{
+  int i;
+
+  for (i = 0; i  target_list-nelts; i++)
+{
+  const char *target = APR_ARRAY_IDX(target_list, i, const char *);
+  const char *target_abspath;
+
+  SVN_ERR(svn_dirent_get_absolute(target_abspath, target, scratch_pool));
+  *is_in_target_list = (svn_dirent_skip_ancestor(target_abspath,
+ local_abspath) != NULL);
+  if (*is_in_target_list)
+return SVN_NO_ERROR;
+}
+
+  return SVN_NO_ERROR;
+}
+
+/* If any children of LOCAL_ABSPATH have been moved-here
+ * or moved-away, verify that both halfs of each move are
+ * in the revert target list. */
+static svn_error_t *
+check_moves(const char *local_abspath,
+const apr_array_header_t *target_list,
+svn_wc_context_t *wc_ctx,
+apr_pool_t *scratch_pool)
+{
+  const char *moved_to_abspath;
+  const char *copy_op_root_abspath;
+  const char *moved_from_abspath;
+  const char *delete_op_root_abspath;
+  svn_error_t *err;
+
+  err = svn_wc__node_was_moved_away(moved_to_abspath,
+copy_op_root_abspath,
+wc_ctx, local_abspath,
+scratch_pool, scratch_pool);
+  if (err)
+{
+  if (err-apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+{
+  svn_error_clear(err);
+  moved_to_abspath = NULL;
+  copy_op_root_abspath = NULL;
+}
+  else
+return svn_error_trace(err);
+}
+
+  if (moved_to_abspath  copy_op_root_abspath 
+  strcmp(moved_to_abspath, copy_op_root_abspath) == 0)
+{  
+  svn_boolean_t is_in_target_list;
+
+  SVN_ERR(path_is_in_target_list(is_in_target_list,
+ moved_to_abspath, target_list,
+ scratch_pool));
+  if (!is_in_target_list)
+{
+  /* TODO: If the moved-away node has no post-move mods
+   * we can just add it to the target list. */
+  return svn_error_createf(
+   SVN_ERR_ILLEGAL_TARGET, NULL,
+   _(Cannot revert '%s' because it was moved to '%s' 
+ which is not part of the revert; both sides of 
+ the move must be reverted together),
+   svn_dirent_local_style(local_abspath, scratch_pool),
+   svn_dirent_local_style(moved_to_abspath, scratch_pool));
+}
+}
+
+  err = svn_wc__node_was_moved_here(moved_from_abspath,
+delete_op_root_abspath,
+wc_ctx, local_abspath,
+scratch_pool, scratch_pool);
+  if (err)
+{
+  if (err-apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+{
+  svn_error_clear(err);
+  moved_from_abspath = NULL;
+  delete_op_root_abspath = NULL;
+}
+  else
+return svn_error_trace(err);
+}
+
+  if (moved_from_abspath  delete_op_root_abspath 
+  strcmp(moved_from_abspath, delete_op_root_abspath

svn commit: r1157244 - in /subversion/trunk/subversion: libsvn_client/revert.c tests/cmdline/copy_tests.py

2011-08-12 Thread stsp
Author: stsp
Date: Fri Aug 12 20:38:38 2011
New Revision: 1157244

URL: http://svn.apache.org/viewvc?rev=1157244view=rev
Log:
Revert r1157172. I have changed my mind about how revert should handle
moves (see http://svn.haxx.se/dev/archive-2011-08/0232.shtml).

A future commit will make 'svn revert' transform the other half of a move
into a plain copy/deletion if only one half of a move is reverted.

Modified:
subversion/trunk/subversion/libsvn_client/revert.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/libsvn_client/revert.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/revert.c?rev=1157244r1=1157243r2=1157244view=diff
==
--- subversion/trunk/subversion/libsvn_client/revert.c (original)
+++ subversion/trunk/subversion/libsvn_client/revert.c Fri Aug 12 20:38:38 2011
@@ -109,124 +109,6 @@ revert(void *baton, apr_pool_t *result_p
   return SVN_NO_ERROR;
 }
 
-/* Set *IS_IN_TARGET_LIST to TRUE if LOCAL_ABSPATH is an element
- * or a child of an element in TARGET_LIST. Else return FALSE. */
-static svn_error_t *
-path_is_in_target_list(svn_boolean_t *is_in_target_list,
-   const char *local_abspath,
-   const apr_array_header_t *target_list,
-   apr_pool_t *scratch_pool)
-{
-  int i;
-
-  for (i = 0; i  target_list-nelts; i++)
-{
-  const char *target = APR_ARRAY_IDX(target_list, i, const char *);
-  const char *target_abspath;
-
-  SVN_ERR(svn_dirent_get_absolute(target_abspath, target, scratch_pool));
-  *is_in_target_list = (svn_dirent_skip_ancestor(target_abspath,
- local_abspath) != NULL);
-  if (*is_in_target_list)
-return SVN_NO_ERROR;
-}
-
-  return SVN_NO_ERROR;
-}
-
-/* If any children of LOCAL_ABSPATH have been moved-here
- * or moved-away, verify that both halfs of each move are
- * in the revert target list. */
-static svn_error_t *
-check_moves(const char *local_abspath,
-const apr_array_header_t *target_list,
-svn_wc_context_t *wc_ctx,
-apr_pool_t *scratch_pool)
-{
-  const char *moved_to_abspath;
-  const char *copy_op_root_abspath;
-  const char *moved_from_abspath;
-  const char *delete_op_root_abspath;
-  svn_error_t *err;
-
-  err = svn_wc__node_was_moved_away(moved_to_abspath,
-copy_op_root_abspath,
-wc_ctx, local_abspath,
-scratch_pool, scratch_pool);
-  if (err)
-{
-  if (err-apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-{
-  svn_error_clear(err);
-  moved_to_abspath = NULL;
-  copy_op_root_abspath = NULL;
-}
-  else
-return svn_error_trace(err);
-}
-
-  if (moved_to_abspath  copy_op_root_abspath 
-  strcmp(moved_to_abspath, copy_op_root_abspath) == 0)
-{  
-  svn_boolean_t is_in_target_list;
-
-  SVN_ERR(path_is_in_target_list(is_in_target_list,
- moved_to_abspath, target_list,
- scratch_pool));
-  if (!is_in_target_list)
-{
-  /* TODO: If the moved-away node has no post-move mods
-   * we can just add it to the target list. */
-  return svn_error_createf(
-   SVN_ERR_ILLEGAL_TARGET, NULL,
-   _(Cannot revert '%s' because it was moved to '%s' 
- which is not part of the revert; both sides of 
- the move must be reverted together),
-   svn_dirent_local_style(local_abspath, scratch_pool),
-   svn_dirent_local_style(moved_to_abspath, scratch_pool));
-}
-}
-
-  err = svn_wc__node_was_moved_here(moved_from_abspath,
-delete_op_root_abspath,
-wc_ctx, local_abspath,
-scratch_pool, scratch_pool);
-  if (err)
-{
-  if (err-apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-{
-  svn_error_clear(err);
-  moved_from_abspath = NULL;
-  delete_op_root_abspath = NULL;
-}
-  else
-return svn_error_trace(err);
-}
-
-  if (moved_from_abspath  delete_op_root_abspath 
-  strcmp(moved_from_abspath, delete_op_root_abspath) == 0)
-{  
-  svn_boolean_t is_in_target_list;
-
-  SVN_ERR(path_is_in_target_list(is_in_target_list,
- moved_from_abspath, target_list,
- scratch_pool));
-  if (!is_in_target_list)
-{
-  /* TODO: If the moved-here node has no post-move mods
-   * we can just add it to the target list. */
-  return svn_error_createf(
-   SVN_ERR_ILLEGAL_TARGET, NULL

svn commit: r1157246 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c

2011-08-12 Thread stsp
Author: stsp
Date: Fri Aug 12 20:49:09 2011
New Revision: 1157246

URL: http://svn.apache.org/viewvc?rev=1157246view=rev
Log:
When reverting one half of a move, transform the other half into a
plain addition/copy.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_NODE_INFO): Return the moved_here column.
  (STMT_SELECT_NODE_INFO_WITH_LOCK): Same here, just for consistency.

* subversion/libsvn_wc/wc_db.c
  (clear_moved_to): New helper for op_revert_txn and op_revert_recursive_txn.
  (op_revert_txn, op_revert_recursive_txn): Clear the moved-to relpath at
   the delete-half of a move for any reverted moved-here node.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1157246r1=1157245r2=1157246view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Aug 12 20:49:09 
2011
@@ -29,7 +29,7 @@
 -- STMT_SELECT_NODE_INFO
 SELECT op_depth, repos_id, repos_path, presence, kind, revision, checksum,
   translated_size, changed_revision, changed_date, changed_author, depth,
-  symlink_target, last_mod_time, properties
+  symlink_target, last_mod_time, properties, moved_here
 FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2
 ORDER BY op_depth DESC
@@ -38,7 +38,7 @@ ORDER BY op_depth DESC
 SELECT op_depth, nodes.repos_id, nodes.repos_path, presence, kind, revision,
   checksum, translated_size, changed_revision, changed_date, changed_author,
   depth, symlink_target, last_mod_time, properties, lock_token, lock_owner,
-  lock_comment, lock_date
+  lock_comment, lock_date, moved_here
 FROM nodes
 LEFT OUTER JOIN lock ON nodes.repos_id = lock.repos_id
   AND nodes.repos_path = lock.repos_relpath

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1157246r1=1157245r2=1157246view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Aug 12 20:49:09 2011
@@ -5159,6 +5159,39 @@ svn_wc__db_op_set_tree_conflict(svn_wc__
 }
 
 
+/* Clear moved-to information at the delete-half of the move which
+ * moved LOCAL_RELPATH here. This transforms the move into a simple delete. */
+static svn_error_t *
+clear_moved_to(const char *local_relpath,
+   svn_wc__db_wcroot_t *wcroot,
+   apr_pool_t *scratch_pool)
+{
+  svn_sqlite__stmt_t *stmt;
+  svn_boolean_t have_row;
+  const char *moved_from_relpath;
+
+  SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
+STMT_SELECT_MOVED_FROM_RELPATH));
+  SVN_ERR(svn_sqlite__bindf(stmt, is, wcroot-wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__step(have_row, stmt));
+  if (!have_row)
+{
+  SVN_ERR(svn_sqlite__reset(stmt));
+  return SVN_NO_ERROR;
+}
+
+  moved_from_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
+  SVN_ERR(svn_sqlite__reset(stmt));
+
+  SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
+STMT_CLEAR_MOVED_TO_RELPATH));
+  SVN_ERR(svn_sqlite__bindf(stmt, is, wcroot-wc_id,
+moved_from_relpath));
+  SVN_ERR(svn_sqlite__step_done(stmt));
+
+  return SVN_NO_ERROR;
+}
+
 /* This implements svn_wc__db_txn_callback_t */
 static svn_error_t *
 op_revert_txn(void *baton,
@@ -5169,6 +5202,7 @@ op_revert_txn(void *baton,
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
   apr_int64_t op_depth;
+  svn_boolean_t moved_here;
   int affected_rows;
 
   /* ### Similar structure to op_revert_recursive_txn, should they be
@@ -5214,6 +5248,7 @@ op_revert_txn(void *baton,
 }
 
   op_depth = svn_sqlite__column_int64(stmt, 0);
+  moved_here = svn_sqlite__column_boolean(stmt, 15);
   SVN_ERR(svn_sqlite__reset(stmt));
 
   if (op_depth  0  op_depth == relpath_depth(local_relpath))
@@ -5253,6 +5288,9 @@ op_revert_txn(void *baton,
   SVN_ERR(svn_sqlite__bindf(stmt, is, wcroot-wc_id, local_relpath));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
+  if (moved_here)
+SVN_ERR(clear_moved_to(local_relpath, wcroot, scratch_pool));
+
   /* Clear the moved-to path of the BASE node. */
   SVN_ERR(svn_sqlite__get_statement(stmt, wcroot-sdb,
 STMT_CLEAR_MOVED_TO_RELPATH));
@@ -5288,6 +5326,7 @@ op_revert_recursive_txn(void *baton,
   svn_boolean_t have_row;
   apr_int64_t op_depth;
   int affected_rows;
+  apr_pool_t *iterpool;
 
   /* ### Similar structure to op_revert_txn, should they be
  combined? */
@@ -5355,6 +5394,25 @@ op_revert_recursive_txn(void *baton

svn propchange: r1157246 - svn:log

2011-08-12 Thread stsp
Author: stsp
Revision: 1157246
Modified property: svn:log

Modified: svn:log at Fri Aug 12 21:13:22 2011
--
--- svn:log (original)
+++ svn:log Fri Aug 12 21:13:22 2011
@@ -9,3 +9,5 @@ plain addition/copy.
   (clear_moved_to): New helper for op_revert_txn and op_revert_recursive_txn.
   (op_revert_txn, op_revert_recursive_txn): Clear the moved-to relpath at
the delete-half of a move for any reverted moved-here node.
+
+Inspired by: blair



svn commit: r1157911 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

2011-08-15 Thread stsp
Author: stsp
Date: Mon Aug 15 17:04:15 2011
New Revision: 1157911

URL: http://svn.apache.org/viewvc?rev=1157911view=rev
Log:
* subversion/libsvn_wc/wc-metadata.sql: Fix an outdated comment.
Review by: gstein

Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1157911r1=1157910r2=1157911view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Mon Aug 15 17:04:15 
2011
@@ -316,8 +316,8 @@ CREATE TABLE NODES (
  BASE node, the location of the initial checkout.
 
  When op_depth != 0, they indicate where this node was copied/moved from.
- In this case, the fields are set only on the root of the operation,
- and are NULL for all children. */
+ In this case, the fields set the root of the operation and for all
+ children. */
   repos_id  INTEGER REFERENCES REPOSITORY (id),
   repos_path  TEXT,
   revision  INTEGER,




svn commit: r1157912 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

2011-08-15 Thread stsp
Author: stsp
Date: Mon Aug 15 17:05:50 2011
New Revision: 1157912

URL: http://svn.apache.org/viewvc?rev=1157912view=rev
Log:
Follow-up to r1157911:
* subversion/libsvn_wc/wc-metadata.sql: Fix typo in comment.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1157912r1=1157911r2=1157912view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Mon Aug 15 17:05:50 
2011
@@ -316,7 +316,7 @@ CREATE TABLE NODES (
  BASE node, the location of the initial checkout.
 
  When op_depth != 0, they indicate where this node was copied/moved from.
- In this case, the fields set the root of the operation and for all
+ In this case, the fields are set for the root of the operation and for all
  children. */
   repos_id  INTEGER REFERENCES REPOSITORY (id),
   repos_path  TEXT,




svn commit: r1158565 - /subversion/site/publish/docs/release-notes/1.7.html

2011-08-17 Thread stsp
Author: stsp
Date: Wed Aug 17 08:17:45 2011
New Revision: 1158565

URL: http://svn.apache.org/viewvc?rev=1158565view=rev
Log:
* publish/docs/release-notes/1.7.html
  (sef): Say 'neon' instead of 'libsvn_ra_neon' -- we don't need to be
   that technical here.

Modified:
subversion/site/publish/docs/release-notes/1.7.html

Modified: subversion/site/publish/docs/release-notes/1.7.html
URL: 
http://svn.apache.org/viewvc/subversion/site/publish/docs/release-notes/1.7.html?rev=1158565r1=1158564r2=1158565view=diff
==
--- subversion/site/publish/docs/release-notes/1.7.html (original)
+++ subversion/site/publish/docs/release-notes/1.7.html Wed Aug 17 08:17:45 2011
@@ -880,7 +880,7 @@ But because of some remaining issues (fo
   issue #3980/a, and
 a href=http://subversion.tigris.org/issues/show_bug.cgi?id=3981;
   issue #3981/a),
-Subversion 1.7 still uses libsvn_ra_neon by default.
+Subversion 1.7 still uses neon by default.
 Remaining problems are mostly due to insufficient infrastructure deployed
 in the wild wild web, such as HTTP proxies that do not support HTTP/1.1.
 Workarounds for these problems will be implemented for the next release.




svn commit: r1158617 - in /subversion/trunk/subversion: libsvn_wc/ tests/cmdline/

2011-08-17 Thread stsp
Author: stsp
Date: Wed Aug 17 10:33:12 2011
New Revision: 1158617

URL: http://svn.apache.org/viewvc?rev=1158617view=rev
Log:
Remove reverted copied files and directories from disk, if they weren't
modified after being copied.

To achieve this we add more columns to rows in the revert list:
the node kind, the repos_id (which is not NULL for copies),
the op_root, and, if the node is a file, the pristine checksum.

While restoring the BASE on-disk state, process nodes in the revert list
marked as copies in a special way: Compare reverted copied files with
their pristines, and remove the ones that match from disk. Next, remove
any reverted copied directories which are left empty as a result.

This commit addresses issues #3101 and #876, and my own annoyance at
unversioned things left behind in my testing WCs (been testing 'svn move'
with subsequent 'revert' a lot lately).

We could take this further and remove copied files which were modified
post-copy (after all, we also destroy textual modifications to files which
were not copied). But that's a decision for another day.

Review by: julianfoad

* subversion/tests/cmdline/merge_tests.py
  (merge_away_subtrees_noninheritable_ranges): No longer need to remove
   unversioned files after revert.

* subversion/tests/cmdline/depth_tests.py
  (excluded_path_misc_operation): No longer need to remove unversioned files
   after revert.

* subversion/tests/cmdline/revert_tests.py
  (status_of_missing_dir_after_revert_replaced_with_history_dir): No longer 
   need to remove unversioned files. And don't expect them in status output.

* subversion/libsvn_wc/adm_ops.c
  (revert_restore_handle_copied_file, revert_restore_handle_copied_dirs,
   compare_revert_list_copied_children): New.
  (revert_restore): When reverting copies, remove their remains from disk,
   except for files which were modified after being copied, and directories
   that contain unversioned files.

* subversion/libsvn_wc/wc-queries.sql
  (revert_list): Add new columns OP_DEPTH, REPOS_ID, KIND, CHECKSUM.
   Copy values from rows deleted from the NODES table into them.
   Nothing changes for actual-only nodes.
  (STMT_SELECT_REVERT_LIST): Get the new columns.
  (STMT_SELECT_REVERT_LIST_COPIED_CHILDREN): New statement which returns
   all copied children within a given reverted local_relpath.

* subversion/libsvn_wc/wc.h
  (svn_wc__compare_file_with_pristine): Declare.

* subversion/libsvn_wc/questions.c
  (compare_and_verify): Renamed to ...
  (svn_wc__compare_file_with_pristine): ... this, so the revert code can
   access this function. No modifications were made to the implementation.
  (svn_wc__internal_file_modified_p): Track above function rename.

* subversion/libsvn_wc/wc_db.c
  (revert_list_read_baton): Add COPIED_HERE, KIND, and PRISTINE_CHECKSUM.
  (revert_list_read): Populate the new baton fields.
  (svn_wc__db_revert_list_read): Add COPIED_HERE, KIND, and PRISTINE_CHECKSUM
   output parameters.
  (revert_list_read_copied_children_baton): New.
  (revert_list_read_copied_children): New. Returns a list of all copied
   children which existed within a reverted subtree.
  (svn_wc__db_revert_list_read_copied_children): Exposes the 
   revert_list_read_copied_children() function, wrapping it in an sqlite
   transaction.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_revert_list_read): Declare new output parameters COPIED_HERE,
   KIND, and PRISTINE_CHECKSUM. Update docstring.
  (svn_wc__db_revert_list_read_copied_children): Declare.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/questions.c
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc.h
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/cmdline/depth_tests.py
subversion/trunk/subversion/tests/cmdline/merge_tests.py
subversion/trunk/subversion/tests/cmdline/revert_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1158617r1=1158616r2=1158617view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Wed Aug 17 10:33:12 2011
@@ -29,6 +29,7 @@
 
 
 #include string.h
+#include stdlib.h
 
 #include apr_pools.h
 #include apr_tables.h
@@ -1291,6 +1292,186 @@ remove_conflict_file(svn_boolean_t *noti
 }
 
 
+/* Remove the reverted copied file at LOCAL_ABSPATH from disk if it was
+ * not modified after being copied. Use FILESIZE and PRISTINE_CHECKSUM to
+ * detect modification.
+ * If NEW_KIND is not NULL, return the resulting on-disk kind of the node
+ * at LOCAL_ABSPATH in *NEW_KIND. */
+static svn_error_t *
+revert_restore_handle_copied_file(svn_node_kind_t *new_kind

svn commit: r1158619 - /subversion/trunk/CHANGES

2011-08-17 Thread stsp
Author: stsp
Date: Wed Aug 17 10:42:16 2011
New Revision: 1158619

URL: http://svn.apache.org/viewvc?rev=1158619view=rev
Log:
* CHANGES: Add an entry for issue #3101, fixed for 1.8.

Modified:
subversion/trunk/CHANGES

Modified: subversion/trunk/CHANGES
URL: 
http://svn.apache.org/viewvc/subversion/trunk/CHANGES?rev=1158619r1=1158618r2=1158619view=diff
==
--- subversion/trunk/CHANGES (original)
+++ subversion/trunk/CHANGES Wed Aug 17 10:42:16 2011
@@ -2,6 +2,9 @@ Version 1.8.0
 (?? ??? 2011, from /branches/1.8.x)
 http://svn.apache.org/repos/asf/subversion/tags/1.8.0
 
+ User-visible changes:
+* don't leave unversioned files when reverting copies (issue #3101)
+
  Developer-visible changes:
   - API changes:
 * fix inconsistent handling of log revs without changed paths (issue #3694)




svn propchange: r1158617 - svn:log

2011-08-17 Thread stsp
Author: stsp
Revision: 1158617
Modified property: svn:log

Modified: svn:log at Wed Aug 17 10:44:59 2011
--
--- svn:log (original)
+++ svn:log Wed Aug 17 10:44:59 2011
@@ -71,4 +71,5 @@ Review by: julianfoad
 * subversion/libsvn_wc/wc_db.h
   (svn_wc__db_revert_list_read): Declare new output parameters COPIED_HERE,
KIND, and PRISTINE_CHECKSUM. Update docstring.
+  (svn_wc__db_revert_list_copied_child_info_t): New.
   (svn_wc__db_revert_list_read_copied_children): Declare.



svn commit: r1158634 - /subversion/trunk/subversion/svn/main.c

2011-08-17 Thread stsp
Author: stsp
Date: Wed Aug 17 11:27:00 2011
New Revision: 1158634

URL: http://svn.apache.org/viewvc?rev=1158634view=rev
Log:
* subversion/svn/main.c
  (svn_cl__cmd_table): Fix an error in the 'svn revert' help text.
   The text used to say that 'svn revert' didn't restore removed directories
   (removed via OS commands, not 'svn rm'). This was true in 1.6, but is not
   true anymore in 1.7.

Modified:
subversion/trunk/subversion/svn/main.c

Modified: subversion/trunk/subversion/svn/main.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/main.c?rev=1158634r1=1158633r2=1158634view=diff
==
--- subversion/trunk/subversion/svn/main.c (original)
+++ subversion/trunk/subversion/svn/main.c Wed Aug 17 11:27:00 2011
@@ -1184,7 +1184,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
  usage: revert PATH...\n
  \n
Note:  this subcommand does not require network access, and resolves\n
-   any conflicted states.  However, it does not restore removed 
directories.\n),
+   any conflicted states.\n),
 {opt_targets, 'R', opt_depth, 'q', opt_changelist} },
 
   { status, svn_cl__status, {stat, st}, N_




svn commit: r1158636 - /subversion/branches/1.7.x/STATUS

2011-08-17 Thread stsp
Author: stsp
Date: Wed Aug 17 11:29:01 2011
New Revision: 1158636

URL: http://svn.apache.org/viewvc?rev=1158636view=rev
Log:
* STATUS: Nominate r1158634.

Modified:
subversion/branches/1.7.x/STATUS

Modified: subversion/branches/1.7.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1158636r1=1158635r2=1158636view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Aug 17 11:29:01 2011
@@ -209,6 +209,13 @@ Candidate changes:
Votes:
  +1: rhuijben
 
+  * r1158634
+Fix error in help text of 'svn revert'.
+Justification:
+  Help texts should document the current behaviour, not past behaviour.
+Votes:
+  +1: stsp
+
 Veto-blocked changes:
 =
 




svn commit: r1158726 - /subversion/branches/1.7.x/STATUS

2011-08-17 Thread stsp
Author: stsp
Date: Wed Aug 17 14:10:30 2011
New Revision: 1158726

URL: http://svn.apache.org/viewvc?rev=1158726view=rev
Log:
* STATUS: The 1.7.x-r1155160 branch looks good to me, update my vote.

Modified:
subversion/branches/1.7.x/STATUS

Modified: subversion/branches/1.7.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1158726r1=1158725r2=1158726view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Aug 17 14:10:30 2011
@@ -111,9 +111,9 @@ Candidate changes:
Branch:
  ^/subversion/branches/1.7.x-r1155160
Votes:
- +1: rhuijben
- +0: stsp, cmpilato (Without branch: Change looks good, but there is a
- merge conflict. Please create a backport branch.)
+ +1: rhuijben, stsp
+ +1: cmpilato (Without branch: Change looks good, but there is a
+   merge conflict. Please create a backport branch.)
 
  * r1158187, r1158196, r1158201, r1158207
Fix issues #2557 and #3987: 'svn info symlink/to/wc'.




svn commit: r1158875 - in /subversion/trunk/subversion: libsvn_wc/adm_ops.c libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c libsvn_wc/wc_db.h tests/cmdline/copy_tests.py tests/cmdline/revert_tests.py

2011-08-17 Thread stsp
Author: stsp
Date: Wed Aug 17 19:14:09 2011
New Revision: 1158875

URL: http://svn.apache.org/viewvc?rev=1158875view=rev
Log:
Make 'svn revert' remove any kind of copied file, regardless of whether
the file was modified post-copy.

The rationale for this change can be found in a comment by Julian Foad
on issue #3601: http://subversion.tigris.org/issues/show_bug.cgi?id=3101#desc6
Quote:
  svn revert should undo the local text and prop changes, undo the scheduling,
  and also undo the copying of the file into its new location on disk,
  since that is (like prop changes) an operation that Subversion performed
  on the user's behalf as a local modification of the user's working copy.

Most parts of this change are concerned with removing the pristine checksum
comparison revert_restore_handle_copied_file() was doing. A fix for a bug
in revert_list_read() uncovered by a failing test is also included.

* subversion/tests/cmdline/copy_tests.py
  (remove_conflict_file): No need to remove 'pi' after revert.

* subversion/tests/cmdline/revert_tests.py
  (revert_tree_conflicts_in_updated_files): Expect 'A/D/G/rho' to be
   delete from disk after revert. No need to delete it manually.

* subversion/libsvn_wc/adm_ops.c
  (revert_restore_handle_copied_file): Remove. This was wrapping the
   comparison to the pristine file, which is now unnecessary.
  (revert_restore_handle_copied_dirs, revert_restore): Remove all reverted
   copied files from disk. Update some comments.

* subversion/libsvn_wc/wc-queries.sql
  (revert_list, trigger_revert_list_nodes, STMT_SELECT_REVERT_LIST,
   STMT_SELECT_REVERT_LIST_COPIED_CHILDREN): Drop the pristine CHECKSUM.
   It isn't needed anymore.

* subversion/libsvn_wc/wc_db.c
  (revert_list_read_baton): Remove PRISTINE_CHECKSUM.
  (revert_list_read): Remove handling of the pristine checksum.
   Fix a bug: The COPIED_HERE output parameter wasn't set correctly if a
   copied node also had an entry in the ACTUAL_NODES table. E.g. a copied
   node which was also a tree-conflict victim was not recognised as a copy
   by the revert code, and left behind unversioned on disk. Set COPIED_HERE
   correctly in this case, too.
  (svn_wc__db_revert_list_read): Remove PRISTINE_CHECKSUM output parameter.
  (revert_list_read_copied_children): Remove handling of the pristine checksum.
   Small indentation fixes.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_revert_list_read): Remove PRISTINE_CHECKSUM output parameter.
  (svn_wc__db_revert_list_copied_child_info_t): Remove PRISTINE_CHECKSUM.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/cmdline/copy_tests.py
subversion/trunk/subversion/tests/cmdline/revert_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1158875r1=1158874r2=1158875view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Wed Aug 17 19:14:09 2011
@@ -1292,48 +1292,6 @@ remove_conflict_file(svn_boolean_t *noti
 }
 
 
-/* Remove the reverted copied file at LOCAL_ABSPATH from disk if it was
- * not modified after being copied. Use FILESIZE and PRISTINE_CHECKSUM to
- * detect modification.
- * If NEW_KIND is not NULL, return the resulting on-disk kind of the node
- * at LOCAL_ABSPATH in *NEW_KIND. */
-static svn_error_t *
-revert_restore_handle_copied_file(svn_node_kind_t *new_kind,
-  svn_wc__db_t *db,
-  const char *local_abspath,
-  svn_filesize_t filesize,
-  const svn_checksum_t *pristine_checksum,
-  apr_pool_t *scratch_pool)
-{
-  svn_stream_t *pristine_stream;
-  svn_filesize_t pristine_size;
-  svn_boolean_t has_text_mods;
-
-  if (new_kind)
-*new_kind = svn_node_file;
-
-  SVN_ERR(svn_wc__db_pristine_read(pristine_stream, pristine_size,
-   db, local_abspath, pristine_checksum,
-   scratch_pool, scratch_pool));
-  SVN_ERR(svn_wc__compare_file_with_pristine(has_text_mods, db,
- local_abspath,
- filesize,
- pristine_stream,
- pristine_size,
- FALSE, FALSE, FALSE,
- scratch_pool));
-
-  if (!has_text_mods)
-{
-  SVN_ERR(svn_io_remove_file2(local_abspath, FALSE, scratch_pool));
-  if (new_kind)
-*new_kind = svn_node_none

  1   2   3   4   5   6   7   8   9   10   >