You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Doug Brown <do...@schmorgal.com> on 2017/07/16 23:48:24 UTC

[PATCH] add ability to export a specific revision when a working copy path is supplied

The attached patch fixes an assertion failure when exporting from a
working copy with the -r option when you have svn:externals that use the
root-relative ^/ syntax, and updates the
export_revision_with_root_relative_external test I recently wrote that
checks for this situation.

I'm completely new to the Subversion codebase and would appreciate
feedback on anything I should have done differently for this fix.  I'm
unsure if this is the correct fix for this problem, but it definitely
makes the test pass and works properly for exporting in the situation
where I originally found this problem.  I've tested with "make check"
and everything passes.  Daniel Shahaf very graciously nudged me in the
direction of writing this patch myself -- thanks for all your help Daniel!

The patch contains the log message, which explains the change in a bit
more detail.

Doug


Re: [PATCH] add ability to export a specific revision when a working copy path is supplied (v2)

Posted by Philip Martin <ph...@codematters.co.uk>.
Daniel Shahaf <d....@daniel.shahaf.name> writes:

> Philip Martin wrote on Tue, 18 Jul 2017 17:01 +0100:
>> Committed as r1802316.  Thanks!
>
> What do you think about backporting this to 1.9.7, Philip?  While at the API
> level this adds a new promise to the docstring, at the CLI level this fixes
> an assertion error in a valid instance of usage #2 of 'export'.

Agreed, I think it meets the criteria for a backport.

-- 
Philip

Re: [PATCH] add ability to export a specific revision when a working copy path is supplied (v2)

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Philip Martin wrote on Tue, 18 Jul 2017 17:01 +0100:
> Doug Brown <do...@schmorgal.com> writes:
> 
> > Thanks for your feedback! That change makes perfect sense. Here is a
> > second attempt at this patch that I think addresses everything you
> > listed. Patch with log message is attached.
> 
> Committed as r1802316.  Thanks!

What do you think about backporting this to 1.9.7, Philip?  While at the API
level this adds a new promise to the docstring, at the CLI level this fixes
an assertion error in a valid instance of usage #2 of 'export'.


Re: [PATCH] add ability to export a specific revision when a working copy path is supplied (v2)

Posted by Philip Martin <ph...@codematters.co.uk>.
Doug Brown <do...@schmorgal.com> writes:

> Thanks for your feedback! That change makes perfect sense. Here is a
> second attempt at this patch that I think addresses everything you
> listed. Patch with log message is attached.

Committed as r1802316.  Thanks!

-- 
Philip

[PATCH] add ability to export a specific revision when a working copy path is supplied (v2)

Posted by Doug Brown <do...@schmorgal.com>.
Hi Philip,

On 7/17/2017 4:14 AM, Philip Martin wrote:
>  - move the conversion from export_directory to svn_client_export5
>  - change the parameter names in export_file_ev2, export_file,
>    export_directory
>  - remove the path code from those functions as it is never used
>  - add SVN_ERR_ASSERT(svn_path_is_url(from_url))

Thanks for your feedback! That change makes perfect sense. Here is a
second attempt at this patch that I think addresses everything you
listed. Patch with log message is attached.

Doug

Re: [PATCH] add ability to export a specific revision when a working copy path is supplied

Posted by Philip Martin <ph...@codematters.co.uk>.
Doug Brown <do...@schmorgal.com> writes:

> * subversion/libsvn_client/export.c
>   (export_directory): Ensure that from_path_or_url is converted to a URL prior
>   to passing it to svn_client__export_externals.

svn_client_export5 has a top level if conditional:

   if (location is url) or (revision implies URL) then
      export from URL
   else
      export from WC

export_directory() is only ever called when exporting from an URL.  I
think svn_client_export5() should be the one to convert the location to
an URL and the lower level export_file_ev2(), export_file() and
export_directory() should be changed to only handle URLs:

 - move the conversion from export_directory to svn_client_export5
 - change the parameter names in export_file_ev2, export_file,
   export_directory
 - remove the path code from those functions as it is never used
 - add SVN_ERR_ASSERT(svn_path_is_url(from_url))



-- 
Philip