svn commit: r1156080 - /subversion/trunk/subversion/libsvn_client/blame.c

2011-08-10 Thread rhuijben
Author: rhuijben
Date: Wed Aug 10 09:34:14 2011
New Revision: 1156080

URL: http://svn.apache.org/viewvc?rev=1156080view=rev
Log:
In the blame calculation: avoid setting an unused variable and pass the url
to the notify handler to tell it the path is not reliable.
(Pass the path anyway)

* subversion/libsvn_client/blame.c
  (file_rev_baton): Remove tmp_path. Add repos_root_url.
  (file_rev_handler): Pass url in the specific revision instead of the fspath.
  (svn_client_blame5): Fetch repos_root_url instead of temp dir.

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

Modified: subversion/trunk/subversion/libsvn_client/blame.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/blame.c?rev=1156080r1=1156079r2=1156080view=diff
==
--- subversion/trunk/subversion/libsvn_client/blame.c (original)
+++ subversion/trunk/subversion/libsvn_client/blame.c Wed Aug 10 09:34:14 2011
@@ -85,7 +85,7 @@ struct file_rev_baton {
   struct rev *rev; /* the rev for which blame is being assigned
   during a diff */
   struct blame_chain *chain;  /* the original blame chain. */
-  const char *tmp_path; /* temp file name to feed svn_io_open_unique_file */
+  const char *repos_root_url;/* To construct a url */
   apr_pool_t *mainpool;  /* lives during the whole sequence of calls */
   apr_pool_t *lastpool;  /* pool used during previous call */
   apr_pool_t *currpool;  /* pool used during this call */
@@ -424,7 +424,11 @@ file_rev_handler(void *baton, const char
   if (frb-ctx-notify_func2)
 {
   svn_wc_notify_t *notify
-= svn_wc_create_notify(path, svn_wc_notify_blame_revision, pool);
+= svn_wc_create_notify_url(
+svn_path_url_add_component2(frb-repos_root_url,
+path+1, pool),
+svn_wc_notify_blame_revision, pool);
+  notify-path = path;
   notify-kind = svn_node_none;
   notify-content_state = notify-prop_state
 = svn_wc_notify_state_inapplicable;
@@ -642,8 +646,7 @@ svn_client_blame5(const char *target,
   frb.merged_chain-pool = pool;
 }
 
-  SVN_ERR(svn_io_temp_dir(frb.tmp_path, pool));
-  frb.tmp_path = svn_dirent_join(frb.tmp_path, tmp, pool),
+  SVN_ERR(svn_ra_get_repos_root2(ra_session, frb.repos_root_url, pool));
 
   frb.mainpool = pool;
   /* The callback will flip the following two pools, because it needs




svn commit: r1156085 - /subversion/trunk/subversion/tests/cmdline/changelist_tests.py

2011-08-10 Thread rhuijben
Author: rhuijben
Date: Wed Aug 10 09:57:48 2011
New Revision: 1156085

URL: http://svn.apache.org/viewvc?rev=1156085view=rev
Log:
Add XFail test for 1.7 issue reported in the users@s.a.o thread
Re: 1.7 corrupts WC when reverting add of changelist member.

* subversion/tests/cmdline/changelist_tests.py
  (readd_after_revert): New function.
  (test_list): Add readd_after_revert.

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

Modified: subversion/trunk/subversion/tests/cmdline/changelist_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/changelist_tests.py?rev=1156085r1=1156084r2=1156085view=diff
==
--- subversion/trunk/subversion/tests/cmdline/changelist_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/changelist_tests.py Wed Aug 10 
09:57:48 2011
@@ -1170,6 +1170,26 @@ def add_remove_unversioned_target(sbox):
  'changelist', unversioned,
   '--remove')
 
+@XFail()
+def readd_after_revert(sbox):
+  add new file to changelist, revert and readd
+  sbox.build(read_only = True)
+
+  dummy = sbox.ospath('dummy')
+  svntest.main.file_write(dummy, dummy contents)
+
+  sbox.simple_add('dummy')
+  svntest.actions.run_and_verify_svn(None, None, [],
+ 'changelist', 'testlist',
+ dummy)
+
+  sbox.simple_revert('dummy')
+
+  svntest.main.file_write(dummy, dummy contents)
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+ 'add', dummy)
+
 
 
 # Run the tests
@@ -1192,6 +1212,7 @@ test_list = [ None,
   revert_deleted_in_changelist,
   add_remove_non_existent_target,
   add_remove_unversioned_target,
+  readd_after_revert,
  ]
 
 if __name__ == '__main__':




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

2011-08-10 Thread rhuijben
Author: rhuijben
Date: Wed Aug 10 10:47:09 2011
New Revision: 1156100

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

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=1156100r1=1156099r2=1156100view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Aug 10 10:47:09 2011
@@ -180,6 +180,16 @@ Candidate changes:
Votes:
  +1: rhuijben
 
+ * r1156085, r1156098
+   Resolve issue #3985, Re: 1.7 corrupts WC when reverting add of changelist
+   member, by fixing a query
+   Justification:
+ Breaking working copies by reverting is unexpected behavior.
+   Notes:
+ r1156085 adds an XFail testcase and r1156098 resolves this issue.
+   Votes:
+ +1: rhuijben
+
 Veto-blocked changes:
 =
 




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

2011-08-10 Thread philip
Author: philip
Date: Wed Aug 10 12:15:18 2011
New Revision: 1156121

URL: http://svn.apache.org/viewvc?rev=1156121view=rev
Log:
* STATUS: Vote for r1156085/r1156098

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=1156121r1=1156120r2=1156121view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Aug 10 12:15:18 2011
@@ -188,7 +188,7 @@ Candidate changes:
Notes:
  r1156085 adds an XFail testcase and r1156098 resolves this issue.
Votes:
- +1: rhuijben
+ +1: rhuijben, philip
 
 Veto-blocked changes:
 =




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

2011-08-10 Thread hwright
Author: hwright
Date: Wed Aug 10 12:26:32 2011
New Revision: 1156131

URL: http://svn.apache.org/viewvc?rev=1156131view=rev
Log:
* STATUS: Vote for and approve the r1156085 group.

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=1156131r1=1156130r2=1156131view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Aug 10 12:26:32 2011
@@ -180,16 +180,6 @@ Candidate changes:
Votes:
  +1: rhuijben
 
- * r1156085, r1156098
-   Resolve issue #3985, Re: 1.7 corrupts WC when reverting add of changelist
-   member, by fixing a query
-   Justification:
- Breaking working copies by reverting is unexpected behavior.
-   Notes:
- r1156085 adds an XFail testcase and r1156098 resolves this issue.
-   Votes:
- +1: rhuijben, philip
-
 Veto-blocked changes:
 =
 
@@ -241,3 +231,13 @@ Veto-blocked changes:
 
 Approved changes:
 =
+
+ * r1156085, r1156098
+   Resolve issue #3985, Re: 1.7 corrupts WC when reverting add of changelist
+   member, by fixing a query
+   Justification:
+ Breaking working copies by reverting is unexpected behavior.
+   Notes:
+ r1156085 adds an XFail testcase and r1156098 resolves this issue.
+   Votes:
+ +1: rhuijben, philip, hwright




svn commit: r1156226 - in /subversion/branches/fs-py/subversion: libsvn_fs_py/fs.c libsvn_fs_py/fs.h libsvn_fs_py/fs_fs.c libsvn_fs_py/py_util.c libsvn_fs_py/py_util.h python/svn/fs.py

2011-08-10 Thread hwright
Author: hwright
Date: Wed Aug 10 15:22:52 2011
New Revision: 1156226

URL: http://svn.apache.org/viewvc?rev=1156226view=rev
Log:
On the fs-py branch:
Add a filesystem class, and have it track the uuid, rather than storing the
fs uuid in the C library.  This commit also includes various cleanups to the
error handling and helper functions.

There remains one test failure in svnlook tests 12.  From the failure log, it
looks like we're somehow loading the wrong module somewhere, but I can't seem
to figure out where.

* subversion/python/svn/fs.py
  (PATH_UUID, PATH_CURRENT): New.
  (FS): New.
  (_create_fs): Implement.
  (_open_fs, _set_uuid): New.

* subversion/libsvn_fs_py/fs.c
  (fs_serialized_init): Fetch the uuid from the python object.

* subversion/libsvn_fs_py/fs.h
  (fs_fs_data_t): Remove the uuid member.
 
* subversion/libsvn_fs_py/fs_fs.c
  (svn_fs_py__open): Don't read the UUID from the file, it will be loaded upon
creating the python object.
  (svn_fs_py__get_uuid): Implement as a simple attribute fetch.
  (svn_fs_py__set_uuid): Call into the python object ot set the uuid.

* subversion/libsvn_fs_py/py_util.c
  (create_py_stack): Simplify, and allow better error generation even if not
given a stack trace.
  (catch_py_exception): Call create_py_stack() even if not given a stack trace.
  (get_string_attr_baton, get_string_attr, svn_fs_py__get_string_attr): New.
  (call_method): Cleanup a stray object.
  (svn_fs_py__call_method): Cleanup baton assignment.

* subversion/libsvn_fs_py/py_util.h
  (svn_fs_py__get_string_attr): New.

Modified:
subversion/branches/fs-py/subversion/libsvn_fs_py/fs.c
subversion/branches/fs-py/subversion/libsvn_fs_py/fs.h
subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c
subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.h
subversion/branches/fs-py/subversion/python/svn/fs.py

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/fs.c?rev=1156226r1=1156225r2=1156226view=diff
==
--- subversion/branches/fs-py/subversion/libsvn_fs_py/fs.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/fs.c Wed Aug 10 15:22:52 
2011
@@ -55,6 +55,7 @@ fs_serialized_init(svn_fs_t *fs, apr_poo
 {
   fs_fs_data_t *ffd = fs-fsap_data;
   const char *key;
+  const char *uuid;
   void *val;
   fs_fs_shared_data_t *ffsd;
   apr_status_t status;
@@ -73,8 +74,9 @@ fs_serialized_init(svn_fs_t *fs, apr_poo
  svnadmin load, so this is a low-priority problem, and we don't
  know of a better way of associating such data with the
  repository. */
+  SVN_ERR(svn_fs_py__get_string_attr(uuid, ffd-p_fs, uuid, pool));
 
-  key = apr_pstrcat(pool, SVN_FSFS_SHARED_USERDATA_PREFIX, ffd-uuid,
+  key = apr_pstrcat(pool, SVN_FSFS_SHARED_USERDATA_PREFIX, uuid,
 (char *) NULL);
   status = apr_pool_userdata_get(val, key, common_pool);
   if (status)

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/fs.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/fs.h?rev=1156226r1=1156225r2=1156226view=diff
==
--- subversion/branches/fs-py/subversion/libsvn_fs_py/fs.h (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/fs.h Wed Aug 10 15:22:52 
2011
@@ -212,9 +212,6 @@ typedef struct fs_fs_data_t
  layouts) or zero (for linear layouts). */
   int max_files_per_dir;
 
-  /* The uuid of this FS. */
-  const char *uuid;
-
   /* The revision that was youngest, last time we checked. */
   svn_revnum_t youngest_rev_cache;
 

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c?rev=1156226r1=1156225r2=1156226view=diff
==
--- subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c Wed Aug 10 
15:22:52 2011
@@ -1204,13 +1204,15 @@ svn_error_t *
 svn_fs_py__open(svn_fs_t *fs, const char *path, apr_pool_t *pool)
 {
   fs_fs_data_t *ffd = fs-fsap_data;
-  apr_file_t *uuid_file;
   int format, max_files_per_dir;
-  char buf[APR_UUID_FORMATTED_LENGTH + 2];
-  apr_size_t limit;
 
   fs-path = apr_pstrdup(fs-pool, path);
 
+  SVN_ERR(svn_fs_py__call_method(ffd-p_fs, ffd-p_module, _open_fs,
+ (s), path));
+  apr_pool_cleanup_register(fs-pool, ffd-p_fs, svn_fs_py__destroy_py_object,
+apr_pool_cleanup_null);
+
   /* Read the FS format number. */
   SVN_ERR(read_format(format, max_files_per_dir,
   path_format(fs, pool), pool));
@@ -1220,16 +1222,6 @@ 

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

2011-08-10 Thread philip
Author: philip
Date: Wed Aug 10 15:23:35 2011
New Revision: 1156227

URL: http://svn.apache.org/viewvc?rev=1156227view=rev
Log:
* STATUS: Nominate issue 3983 fix.

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=1156227r1=1156226r2=1156227view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Aug 10 15:23:35 2011
@@ -180,6 +180,13 @@ Candidate changes:
Votes:
  +1: rhuijben
 
+ * r1155391, r1155404, r1156218
+   Fix issue 3983, import into foreign repository.
+   Justification:
+ It's a regression from 1.6.
+   Votes:
+ +1: philip
+
 Veto-blocked changes:
 =
 




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

2011-08-10 Thread philip
Author: philip
Date: Wed Aug 10 16:33:33 2011
New Revision: 1156256

URL: http://svn.apache.org/viewvc?rev=1156256view=rev
Log:
* STATUS: Add Bert's (email via phone) 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=1156256r1=1156255r2=1156256view=diff
==
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Aug 10 16:33:33 2011
@@ -185,7 +185,7 @@ Candidate changes:
Justification:
  It's a regression from 1.6.
Votes:
- +1: philip
+ +1: philip, rhuijben
 
 Veto-blocked changes:
 =




svn commit: r1156281 - /subversion/trunk/tools/dist/release.py

2011-08-10 Thread hwright
Author: hwright
Date: Wed Aug 10 18:01:30 2011
New Revision: 1156281

URL: http://svn.apache.org/viewvc?rev=1156281view=rev
Log:
New 'move-to-dist' subcommand for release.py.

* tools/dist/release.py
  (move_to_dist): New.
  (main): Add the new subcommand and its arguments.

Modified:
subversion/trunk/tools/dist/release.py

Modified: subversion/trunk/tools/dist/release.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/dist/release.py?rev=1156281r1=1156280r2=1156281view=diff
==
--- subversion/trunk/tools/dist/release.py (original)
+++ subversion/trunk/tools/dist/release.py Wed Aug 10 18:01:30 2011
@@ -513,6 +513,35 @@ def clean_dist(args):
 
 
 #--
+# Move to dist
+
+def move_to_dist(args):
+'Move candidate artifacts to the distribution directory.'
+
+if not args.dist_dir:
+assert_people()
+args.dist_dir = people_dist_dir
+
+if args.target:
+target = args.target
+else:
+target = os.path.join(os.getenv('HOME'), 'public_html', 'svn',
+  str(args.version), 'deploy')
+
+if args.code_name:
+dirname = args.code_name
+else:
+dirname = 'deploy'
+
+logging.info('Moving %s to dist dir \'%s\'' % (str(args.version),
+   args.dist_dir) )
+filenames = glob.glob(os.path.join(target,
+   'subversion-%s.*' % str(args.version)))
+for filename in filenames:
+shutil.move(filename, args.dist_dir)
+
+
+#--
 # Write announcements
 
 def write_news(args):
@@ -695,6 +724,24 @@ def main():
 subparser.add_argument('--dist-dir',
 help='''The directory to clean.''')
 
+# The move-to-dist subcommand
+subparser = subparsers.add_parser('move-to-dist',
+help='''Move candiates and signatures from the temporary
+post location to the permanent distribution
+directory.  If no dist-dir is given, this command
+will assume it is running on people.apache.org.''')
+subparser.set_defaults(func=move_to_dist)
+subparser.add_argument('version', type=Version,
+help='''The release label, such as '1.7.0-alpha1'.''')
+subparser.add_argument('--dist-dir',
+help='''The directory to clean.''')
+subparser.add_argument('--code-name',
+help='''A whimsical name for the release, used only for
+naming the download directory.''')
+subparser.add_argument('--target',
+help='''The full path to the destination used in
+'post-candiates'..''')
+
 # The write-news subcommand
 subparser = subparsers.add_parser('write-news',
 help='''Output to stdout template text for use in the news




svn commit: r1156312 - in /subversion/trunk/subversion: libsvn_client/mergeinfo.c tests/cmdline/mergeinfo_tests.py

2011-08-10 Thread pburba
Author: pburba
Date: Wed Aug 10 18:51:10 2011
New Revision: 1156312

URL: http://svn.apache.org/viewvc?rev=1156312view=rev
Log:
Partial fix for issue #3986 'svn_client_mergeinfo_log API broken with WC
target which inherits mergeinfo from repos'.

* subversion/libsvn_client/mergeinfo.c

  (svn_client__get_wc_or_repos_mergeinfo_catalog): If a target has subtree
   mergeinfo but no explicit mergeinfo of its own, we must ask the repository
   for the target's inherited mergeinfo (if any).  Previously we were
   satisfied with finding only subtree mergeinfo, which is only a partial
   answer.

* subversion/tests/cmdline/mergeinfo_tests.py

  (wc_target_inherits_mergeinfo_from_repos): Update comment about where
   this test fails.

Modified:
subversion/trunk/subversion/libsvn_client/mergeinfo.c
subversion/trunk/subversion/tests/cmdline/mergeinfo_tests.py

Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1156312r1=1156311r2=1156312view=diff
==
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Wed Aug 10 18:51:10 
2011
@@ -560,6 +560,8 @@ svn_client__get_wc_or_repos_mergeinfo_ca
   const char *local_abspath;
   const char *repos_root;
   const char *repos_relpath;
+  svn_mergeinfo_catalog_t target_mergeinfo_cat_wc = NULL;
+  svn_mergeinfo_catalog_t target_mergeinfo_cat_repos = NULL;
 
   SVN_ERR(svn_dirent_get_absolute(local_abspath, target_wcpath,
   scratch_pool));
@@ -581,23 +583,37 @@ svn_client__get_wc_or_repos_mergeinfo_ca
   else
 url = NULL;
 
+  if (!repos_only)
+{
+  SVN_ERR(svn_client__get_wc_mergeinfo_catalog(target_mergeinfo_cat_wc,
+   inherited,
+   include_descendants,
+   inherit,
+   local_abspath,
+   NULL, NULL,
+   ignore_invalid_mergeinfo,
+   ctx,
+   result_pool,
+   scratch_pool));
+
+  /* If we want LOCAL_ABSPATH's inherited mergeinfo, were we able to
+ get it from the working copy?  If not, then we must ask the
+ repository. */
+  if (! ((*inherited)
+ || (inherit == svn_mergeinfo_explicit)
+ || (repos_relpath
+  target_mergeinfo_cat_wc
+  apr_hash_get(target_mergeinfo_cat_wc, repos_relpath,
+ APR_HASH_KEY_STRING
+{
+  repos_only = TRUE;
+  /* We already have any subtree mergeinfo from the working copy, no
+ need to ask the server for it again. */
+  include_descendants = FALSE;
+}
+}
+
   if (repos_only)
-*target_mergeinfo_catalog = NULL;
-  else
-SVN_ERR(svn_client__get_wc_mergeinfo_catalog(target_mergeinfo_catalog,
- inherited,
- include_descendants,
- inherit,
- local_abspath,
- NULL, NULL,
- ignore_invalid_mergeinfo,
- ctx,
- result_pool, scratch_pool));
-
-  /* If there is no WC mergeinfo check the repository for inherited
- mergeinfo, unless TARGET_WCPATH is a local addition or has a
- local modification which has removed all of its pristine mergeinfo. */
-  if (*target_mergeinfo_catalog == NULL)
 {
   /* No need to check the repos if this is a local addition. */
   if (url != NULL)
@@ -631,13 +647,13 @@ svn_client__get_wc_or_repos_mergeinfo_ca
 }
 
   SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
-target_mergeinfo_catalog, ra_session,
+target_mergeinfo_cat_repos, ra_session,
 , target_rev, inherit,
-TRUE, FALSE, TRUE,
+TRUE, include_descendants, TRUE,
 result_pool, scratch_pool));
 
-  if (*target_mergeinfo_catalog
-   apr_hash_get(*target_mergeinfo_catalog, ,
+  if (target_mergeinfo_cat_repos
+   apr_hash_get(target_mergeinfo_cat_repos, ,
   APR_HASH_KEY_STRING))
 {
   *inherited = 

svn commit: r1156347 - /subversion/branches/fs-py/subversion/python/svn/fs.py

2011-08-10 Thread hwright
Author: hwright
Date: Wed Aug 10 20:17:55 2011
New Revision: 1156347

URL: http://svn.apache.org/viewvc?rev=1156347view=rev
Log:
On the fs-py branch:
Explicitly close files in the Python module, per the Python docs.

* subversion/python/svn/fs.py
  (FS.set_uuid, FS._open_fs): Explicitly close a file, rather than just
letting it go out of scope.

Modified:
subversion/branches/fs-py/subversion/python/svn/fs.py

Modified: subversion/branches/fs-py/subversion/python/svn/fs.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/python/svn/fs.py?rev=1156347r1=1156346r2=1156347view=diff
==
--- subversion/branches/fs-py/subversion/python/svn/fs.py (original)
+++ subversion/branches/fs-py/subversion/python/svn/fs.py Wed Aug 10 20:17:55 
2011
@@ -35,7 +35,10 @@ class FS(object):
 uuid_in = uuid.uuid1()
 self.uuid = uuid_in
 
-open(self.__path_uuid, 'wb').write(str(self.uuid) + '\n')
+f = open(self.__path_uuid, 'wb')
+f.write(str(self.uuid) + '\n')
+f.close()
+
 # We use the permissions of the 'current' file, because the 'uuid'
 # file does not exist during repository creation.
 shutil.copymode(self.__path_current, self.__path_uuid)
@@ -47,8 +50,9 @@ class FS(object):
 
 def _open_fs(self):
 'Open an existing Subvesion filesystem'
-self.uuid = uuid.UUID(open(
-self.__path_uuid, 'rb').readline().rstrip())
+f = open(self.__path_uuid, 'rb')
+self.uuid = uuid.UUID(f.readline().rstrip())
+f.close()
 
 
 def __setup_paths(self):




svn commit: r1156375 - /subversion/branches/fs-py/subversion/python/svn/fs.py

2011-08-10 Thread hwright
Author: hwright
Date: Wed Aug 10 21:26:36 2011
New Revision: 1156375

URL: http://svn.apache.org/viewvc?rev=1156375view=rev
Log:
On the fs-py branch:
Followup to r1156347: use a bit cleaner syntax to automagically close files.

* subversion/python/svn/fs.py
  (FS.set_uuid, FS._open_fs): Use the with statement.

Modified:
subversion/branches/fs-py/subversion/python/svn/fs.py

Modified: subversion/branches/fs-py/subversion/python/svn/fs.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/python/svn/fs.py?rev=1156375r1=1156374r2=1156375view=diff
==
--- subversion/branches/fs-py/subversion/python/svn/fs.py (original)
+++ subversion/branches/fs-py/subversion/python/svn/fs.py Wed Aug 10 21:26:36 
2011
@@ -35,9 +35,8 @@ class FS(object):
 uuid_in = uuid.uuid1()
 self.uuid = uuid_in
 
-f = open(self.__path_uuid, 'wb')
-f.write(str(self.uuid) + '\n')
-f.close()
+with open(self.__path_uuid, 'wb') as f:
+f.write(str(self.uuid) + '\n')
 
 # We use the permissions of the 'current' file, because the 'uuid'
 # file does not exist during repository creation.
@@ -50,9 +49,8 @@ class FS(object):
 
 def _open_fs(self):
 'Open an existing Subvesion filesystem'
-f = open(self.__path_uuid, 'rb')
-self.uuid = uuid.UUID(f.readline().rstrip())
-f.close()
+with open(self.__path_uuid, 'rb') as f:
+self.uuid = uuid.UUID(f.readline().rstrip())
 
 
 def __setup_paths(self):




svn commit: r1156417 - in /subversion/branches/fs-py/subversion: libsvn_fs_py/fs_fs.c python/svn/fs.py

2011-08-10 Thread hwright
Author: hwright
Date: Thu Aug 11 00:41:39 2011
New Revision: 1156417

URL: http://svn.apache.org/viewvc?rev=1156417view=rev
Log:
On the fs-py branch:
Just directly call on object method, rather than proxying through a helper
module method.

* subversion/python/svn/fs.py
  (_set_uuid): Remove.

* subversion/libsvn_fs_py/fs_fs.c
  (svn_fs_py__set_uuid): Call the object method, rather than the proxy.

Modified:
subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
subversion/branches/fs-py/subversion/python/svn/fs.py

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c?rev=1156417r1=1156416r2=1156417view=diff
==
--- subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c Thu Aug 11 
00:41:39 2011
@@ -6758,9 +6758,9 @@ svn_fs_py__set_uuid(svn_fs_t *fs,
 {
   fs_fs_data_t *ffd = fs-fsap_data;
 
-  return svn_error_trace(svn_fs_py__call_method(NULL, ffd-p_module,
-_set_uuid,
-(Os), ffd-p_fs, uuid));
+  return svn_error_trace(svn_fs_py__call_method(NULL, ffd-p_fs,
+set_uuid,
+(s), uuid));
 }
 
 /** Node origin lazy cache. */

Modified: subversion/branches/fs-py/subversion/python/svn/fs.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/python/svn/fs.py?rev=1156417r1=1156416r2=1156417view=diff
==
--- subversion/branches/fs-py/subversion/python/svn/fs.py (original)
+++ subversion/branches/fs-py/subversion/python/svn/fs.py Thu Aug 11 00:41:39 
2011
@@ -80,6 +80,3 @@ def _create_fs(path, config=None):
 
 def _open_fs(path):
 return FS(path)
-
-def _set_uuid(fs, uuid):
-fs.set_uuid(uuid)




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 commit: r1156447 - in /subversion/branches/fs-py/subversion: libsvn_fs_py/fs_fs.c libsvn_fs_py/py_util.c libsvn_fs_py/py_util.h python/svn/__init__.py python/svn/fs.py python/svn/hash.py

2011-08-10 Thread hwright
Author: hwright
Date: Thu Aug 11 02:25:10 2011
New Revision: 1156447

URL: http://svn.apache.org/viewvc?rev=1156447view=rev
Log:
On the fs-py branch:
Implement the set_revision_proplist functionality in Python, rather than C.
This is something of a checkpoint commit, as most of the tests start failing
after it.

* subversion/python/svn/fs.py
  (): A number of new constants.
  (FS.__path_rev_shard, FS.__path_revprops_shard, FS.__path_rev_absolute,
   FS.__path_rev, FS.__is_pathed_rev, FS.__read_current, FS._get_youngest,
   FS.__ensure_revision_exists, FS._set_revision_proplist, FS.__read_format,
   FS.__update_min_unpacked_rev): New.
  (FS._create_fs): Set a couple of values, determine the right format to
create.
  (FS._open_fs): Read the format and a couple other values upon open.
  (FS.__setup_paths): Initialize a couple more paths.

* subversion/python/svn/__init__.py
  (is_valid_revnum): New.

* subversion/python/svn/hash.py:
  New.

* subversion/libsvn_fs_py/fs_fs.c
  (set_revision_proplist): Rip out the implementation in favor of a python one.
  (svn_fs_py__create): Track a rename in a helper function.
 
* subversion/libsvn_fs_py/py_util.c
  (convert_hash): New.
  (convert_svn_string_t): New.
  (svn_fs_py__convert_hash): Renamed to...
  (svn_fs_py__convert_cstring_hash): ...this.
  (svn_fs_py__convert_proplist): New.

* subversion/libsvn_fs_py/py_util.h
  (svn_fs_py__convert_hash): Renamed to...
  (svn_fs_py__convert_cstring_hash): ...this.
  (svn_fs_py__convert_proplist): New.

Added:
subversion/branches/fs-py/subversion/python/svn/hash.py   (with props)
Modified:
subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c
subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.h
subversion/branches/fs-py/subversion/python/svn/__init__.py
subversion/branches/fs-py/subversion/python/svn/fs.py

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c?rev=1156447r1=1156446r2=1156447view=diff
==
--- subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c Thu Aug 11 
02:25:10 2011
@@ -2850,32 +2850,11 @@ set_revision_proplist(svn_fs_t *fs,
   apr_hash_t *proplist,
   apr_pool_t *pool)
 {
-  SVN_ERR(ensure_revision_exists(fs, rev, pool));
-
-  if (1)
-{
-  const char *final_path = path_revprops(fs, rev, pool);
-  const char *tmp_path;
-  const char *perms_reference;
-  svn_stream_t *stream;
-
-  /* ### do we have a directory sitting around already? we really shouldn't
- ### have to get the dirname here. */
-  SVN_ERR(svn_stream_open_unique(stream, tmp_path,
- svn_dirent_dirname(final_path, pool),
- svn_io_file_del_none, pool, pool));
-  SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR, pool));
-  SVN_ERR(svn_stream_close(stream));
-
-  /* We use the rev file of this revision as the perms reference,
- because when setting revprops for the first time, the revprop
- file won't exist and therefore can't serve as its own reference.
- (Whereas the rev file should already exist at this point.) */
-  SVN_ERR(svn_fs_py__path_rev_absolute(perms_reference, fs, rev, pool));
-  SVN_ERR(move_into_place(tmp_path, final_path, perms_reference, pool));
+  fs_fs_data_t *ffd = fs-fsap_data;
 
-  return SVN_NO_ERROR;
-}
+  SVN_ERR(svn_fs_py__call_method(NULL, ffd-p_fs, _set_revision_proplist,
+ (lO), rev,
+ svn_fs_py__convert_proplist, proplist));
 
   return SVN_NO_ERROR;
 }
@@ -6257,7 +6236,7 @@ svn_fs_py__create(svn_fs_t *fs,
 
   SVN_ERR(svn_fs_py__call_method(ffd-p_fs, ffd-p_module, _create_fs,
  (sO), path,
- svn_fs_py__convert_hash, fs-config));
+ svn_fs_py__convert_cstring_hash, fs-config));
   apr_pool_cleanup_register(fs-pool, ffd-p_fs, svn_fs_py__destroy_py_object,
 apr_pool_cleanup_null);
 

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c?rev=1156447r1=1156446r2=1156447view=diff
==
--- subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c Thu Aug 11 
02:25:10 2011
@@ -378,17 +378,18 @@ svn_fs_py__call_method(PyObject **p_resu
   return svn_error_trace(err);
 }
 
-PyObject *
-svn_fs_py__convert_hash(void *object)
+