Subversion C API

2015-11-06 Thread Ren Wang
I have posted the same question to the stackoverflow, here it is. Looking
forward to hear from you:

 

We are considering to use Subversion as the file system layer to store
version enabled documents. Since the security function will be handled by
other code, I am considering to directly use the Subversion FS C API layer.
I wonder if there any good sample code for using Subversion FS APIs?

 

Someone answered back:

Subversion's FSFS store is meant to be used by the subversion server. While
it might be useable in other scenarios, whatever sits on top of it will
likely have to act much like a subversion server when interacting with it.
Subversion differentiates between client workspaces and the server storage
space. If you are going to leverage subversion components, your application
needs to realize that these two spaces are not the same within a subversion
architecture, and therefore should not be the same within your solution that
uses their components.

Why not just embed a subversion client into the place you desire and then go
from there? The user workspace will still be "the subversion user workspace"
and the server side will be the server side. In fact, check out tortise SVN
(or other desktop integrations of subversion). You might not even need to
write anything.

I asked again with more context for the project:

SVN Client API will have performance penalty since it will go through other
layers such as user authentications, authorizations, transport etc. which
are not needed for us. Subversion server side API will bypass those calls. I
wonder which API mod_dav_svn used.

Regards,

Ren

 



RE: Subversion C API

2015-11-09 Thread Ren Wang
Hi Bert,

 

Thank you very much for the detail explanations.

 

We have been thinking about the option to develop our own repository layer
vs subversion API file:///   repository API (libsvn_fs). This is
why we are looking for programming guide and sample code for supporting our
use cases. So far, we only have the test code from subversion, such as
test_fs project which is not enough for us.

 

I will take a look of the svnmucc code.

 

Regards,

 

Ren

 

From: Bert Huijben [mailto:b...@qqmail.nl] 
Sent: Sunday, November 8, 2015 12:28 PM
To: 'Ren Wang' ; users@subversion.apache.org
Subject: RE: Subversion C API

 

Mod_dav mostly uses the repository layer api. In a few specific cases it
goes into the fs layer directly. sometimes because something isn't mapped,
but in other cases because mod_dav was developed very early in the
development process and the repository layer wasn't as complete as it is
today.

 

But is the client layer really that expensive for you that you can't use it?
Did you measure it?

 

I can't imagine usecases where the performance is that critical that you
really can't afford the thin layer that the file:/// 
repository api has, but don't want a specialized datastore 100% optimized
for your usecase.

 

I can think of a few cases where you might want to avoid the overhead of
having a working copy, but even there the costs aren't usually that high
that it makes sense to spend a lot of time to develop something else.

(And in many cases the still private API behind svnmucc can already help you
there)

 

Bert

 

From: Ren Wang [mailto:renwang...@gmail.com] 
Sent: vrijdag 6 november 2015 19:44
To: users@subversion.apache.org <mailto:users@subversion.apache.org> 
Subject: Subversion C API

 

I have posted the same question to the stackoverflow, here it is. Looking
forward to hear from you:

 

We are considering to use Subversion as the file system layer to store
version enabled documents. Since the security function will be handled by
other code, I am considering to directly use the Subversion FS C API layer.
I wonder if there any good sample code for using Subversion FS APIs?

 

Someone answered back:

Subversion's FSFS store is meant to be used by the subversion server. While
it might be useable in other scenarios, whatever sits on top of it will
likely have to act much like a subversion server when interacting with it.
Subversion differentiates between client workspaces and the server storage
space. If you are going to leverage subversion components, your application
needs to realize that these two spaces are not the same within a subversion
architecture, and therefore should not be the same within your solution that
uses their components.

Why not just embed a subversion client into the place you desire and then go
from there? The user workspace will still be "the subversion user workspace"
and the server side will be the server side. In fact, check out tortise SVN
(or other desktop integrations of subversion). You might not even need to
write anything.

I asked again with more context for the project:

SVN Client API will have performance penalty since it will go through other
layers such as user authentications, authorizations, transport etc. which
are not needed for us. Subversion server side API will bypass those calls. I
wonder which API mod_dav_svn used.

Regards,

Ren

 



RE: Subversion C API

2015-11-09 Thread Ren Wang
Hi Philip,

Yes, we are looking for the local access and FS API.

The following are the use cases that we need as the starting point:

1) create file and folder
2) open a directory/root and get its latest files and folders
3) modify a file, folder
4) delete file and folder

Not sure if there is a programming guide. From the test source code
(test_fs), I can figure out use case (1), (3) and (4). But not sure how to
do for use case (2) open a directory/root and get its latest files and
folders.




-Original Message-
From: Philip Martin [mailto:philip.mar...@wandisco.com] 
Sent: Monday, November 9, 2015 9:43 AM
To: Ren Wang 
Cc: 'Bert Huijben' ; users@subversion.apache.org
Subject: Re: Subversion C API

The FS API, svn_fs_ and svn_repos_, provides access to a repository on the
local filesystem.  It provides a transactional API to commits:
create a txn, populate the txn, commit or delete the txn.  The servers
svnserve and mod_dav_svn use this API.

The RA API, svn_ra_, provides access to a repository via an URL such as
http://, svn://, file:// etc.  Usually this repository will be on a remote
server running svnserve or mod_dav_svn.  It also provides a transactional
API to commits but is more restricted: the FS API provides random access to
the txn while the RA API requires an ordered pass over the txn.  The client
svnmucc uses this API.

The client API, svn_client_, provides access to a repository via a working
copy or via an URL.  It provides a higher level API that does not expose
transactions, but instead provides functions to make a commit, do an import,
etc.  The client svn uses this API.

If you want network access, or you want to use Subversion's
authentication/authorization, then use the RA or client APIs.  If you want
local access, and more freedom with transaction handling, then use the FS
API.

"Ren Wang"  writes:

> Hi Bert,
>
>  
>
> Thank you very much for the detail explanations.
>
>  
>
> We have been thinking about the option to develop our own repository 
> layer vs subversion API file:///   repository API 
> (libsvn_fs). This is why we are looking for programming guide and 
> sample code for supporting our use cases. So far, we only have the 
> test code from subversion, such as test_fs project which is not enough for
us.
>
>  
>
> I will take a look of the svnmucc code.
>
>  
>
> Regards,
>
>  
>
> Ren
>
>  
>
> From: Bert Huijben [mailto:b...@qqmail.nl]
> Sent: Sunday, November 8, 2015 12:28 PM
> To: 'Ren Wang' ; users@subversion.apache.org
> Subject: RE: Subversion C API
>
>  
>
> Mod_dav mostly uses the repository layer api. In a few specific cases 
> it goes into the fs layer directly. sometimes because something isn't 
> mapped, but in other cases because mod_dav was developed very early in 
> the development process and the repository layer wasn't as complete as 
> it is today.
>
>  
>
> But is the client layer really that expensive for you that you can't use
it?
> Did you measure it?
>
>  
>
> I can't imagine usecases where the performance is that critical that 
> you really can't afford the thin layer that the file:///  
> repository api has, but don't want a specialized datastore 100% 
> optimized for your usecase.
>
>  
>
> I can think of a few cases where you might want to avoid the overhead 
> of having a working copy, but even there the costs aren't usually that 
> high that it makes sense to spend a lot of time to develop something else.
>
> (And in many cases the still private API behind svnmucc can already 
> help you
> there)
>
>  
>
> Bert
>
>  
>
> From: Ren Wang [mailto:renwang...@gmail.com]
> Sent: vrijdag 6 november 2015 19:44
> To: users@subversion.apache.org <mailto:users@subversion.apache.org>
> Subject: Subversion C API
>
>  
>
> I have posted the same question to the stackoverflow, here it is. 
> Looking forward to hear from you:
>
>  
>
> We are considering to use Subversion as the file system layer to store 
> version enabled documents. Since the security function will be handled 
> by other code, I am considering to directly use the Subversion FS C API
layer.
> I wonder if there any good sample code for using Subversion FS APIs?
>
>  
>
> Someone answered back:
>
> Subversion's FSFS store is meant to be used by the subversion server. 
> While it might be useable in other scenarios, whatever sits on top of 
> it will likely have to act much like a subversion server when interacting
with it.
> Subversion differentiates between client workspaces and the server 
> storage space. If you are going to leverage subversion components, 
> your application needs to realize that these 

RE: Subversion C API

2015-11-10 Thread Ren Wang
Great, it works. Thank you so much!

-Original Message-
From: Philip Martin [mailto:philip.mar...@wandisco.com] 
Sent: Monday, November 9, 2015 11:08 AM
To: Ren Wang 
Cc: 'Bert Huijben' ; users@subversion.apache.org
Subject: Re: Subversion C API

The svnlook client uses the FS API to read details of revisions and
transactions.  Look at the code that implements 'svnlook tree'.

"Ren Wang"  writes:

> Hi Philip,
>
> Yes, we are looking for the local access and FS API.
>
> The following are the use cases that we need as the starting point:
>
> 1) create file and folder
> 2) open a directory/root and get its latest files and folders
> 3) modify a file, folder
> 4) delete file and folder
>
> Not sure if there is a programming guide. From the test source code 
> (test_fs), I can figure out use case (1), (3) and (4). But not sure 
> how to do for use case (2) open a directory/root and get its latest 
> files and folders.
>
>
>
>
> -Original Message-
> From: Philip Martin [mailto:philip.mar...@wandisco.com]
> Sent: Monday, November 9, 2015 9:43 AM
> To: Ren Wang 
> Cc: 'Bert Huijben' ; users@subversion.apache.org
> Subject: Re: Subversion C API
>
> The FS API, svn_fs_ and svn_repos_, provides access to a repository on 
> the local filesystem.  It provides a transactional API to commits:
> create a txn, populate the txn, commit or delete the txn.  The servers 
> svnserve and mod_dav_svn use this API.
>
> The RA API, svn_ra_, provides access to a repository via an URL such 
> as http://, svn://, file:// etc.  Usually this repository will be on a 
> remote server running svnserve or mod_dav_svn.  It also provides a 
> transactional API to commits but is more restricted: the FS API 
> provides random access to the txn while the RA API requires an ordered 
> pass over the txn.  The client svnmucc uses this API.
>
> The client API, svn_client_, provides access to a repository via a 
> working copy or via an URL.  It provides a higher level API that does 
> not expose transactions, but instead provides functions to make a 
> commit, do an import, etc.  The client svn uses this API.
>
> If you want network access, or you want to use Subversion's 
> authentication/authorization, then use the RA or client APIs.  If you 
> want local access, and more freedom with transaction handling, then 
> use the FS API.
>
> "Ren Wang"  writes:
>
>> Hi Bert,
>>
>>  
>>
>> Thank you very much for the detail explanations.
>>
>>  
>>
>> We have been thinking about the option to develop our own repository 
>> layer vs subversion API file:///   repository API 
>> (libsvn_fs). This is why we are looking for programming guide and 
>> sample code for supporting our use cases. So far, we only have the 
>> test code from subversion, such as test_fs project which is not 
>> enough for
> us.
>>
>>  
>>
>> I will take a look of the svnmucc code.
>>
>>  
>>
>> Regards,
>>
>>  
>>
>> Ren
>>
>>  
>>
>> From: Bert Huijben [mailto:b...@qqmail.nl]
>> Sent: Sunday, November 8, 2015 12:28 PM
>> To: 'Ren Wang' ; users@subversion.apache.org
>> Subject: RE: Subversion C API
>>
>>  
>>
>> Mod_dav mostly uses the repository layer api. In a few specific cases 
>> it goes into the fs layer directly. sometimes because something isn't 
>> mapped, but in other cases because mod_dav was developed very early 
>> in the development process and the repository layer wasn't as 
>> complete as it is today.
>>
>>  
>>
>> But is the client layer really that expensive for you that you can't 
>> use
> it?
>> Did you measure it?
>>
>>  
>>
>> I can't imagine usecases where the performance is that critical that 
>> you really can't afford the thin layer that the file:///  
>> repository api has, but don't want a specialized datastore 100% 
>> optimized for your usecase.
>>
>>  
>>
>> I can think of a few cases where you might want to avoid the overhead 
>> of having a working copy, but even there the costs aren't usually 
>> that high that it makes sense to spend a lot of time to develop something
else.
>>
>> (And in many cases the still private API behind svnmucc can already 
>> help you
>> there)
>>
>>  
>>
>> Bert
>>
>>  
>>
>> From: Ren Wang [mailto:renwang...@gmail.com]
>> Sent: vrijdag 6 november 2015 19:44
>> To: users@subversion.apache.org <mailto

how to get node property by using C API

2015-11-20 Thread Ren Wang
I would like to know how to get a directory or file property with Subversion
C API, if I already have the node ID and path, what's the API to get file
size and author, creation time etc.?

 

Regards,

 

Ren



RE: how to get node property by using C API

2015-11-21 Thread Ren Wang
Thanks for the response, I will check it out from the sample code. 

 

From: Bert Huijben [mailto:b...@qqmail.nl] 
Sent: Friday, November 20, 2015 1:25 PM
To: 'Ren Wang' ; users@subversion.apache.org
Subject: RE: how to get node property by using C API

 

There should be an api for the size. Author, creation info, etc. are
attached to the revision in which the file was created.

 

Bert

 

From: Ren Wang [mailto:renwang...@gmail.com] 
Sent: vrijdag 20 november 2015 16:19
To: users@subversion.apache.org <mailto:users@subversion.apache.org> 
Subject: how to get node property by using C API

 

I would like to know how to get a directory or file property with Subversion
C API, if I already have the node ID and path, what's the API to get file
size and author, creation time etc.?

 

Regards,

 

Ren



svn_repos_fs_commit_txn error

2015-11-23 Thread Ren Wang
I got an error for creating a new directory to the repository. Strange to me
is that enve the code failed at the svn_repos_fs_commit_txn, but the
directory got created:

 

 

1)  Open repository, repos

2)  Get the latest revision, youngest

3)  Do the following:

svn_fs_txn_t *txn;

svn_fs_root_t *txn_root;

apr_pool_t *subpool = svn_pool_create(pool);

SVN_ERR(svn_repos_fs_begin_txn_for_commit(&txn, &repos, youngest_rev,
"UncleYinan", "log msg", subpool));

SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));

SVN_ERR(svn_fs_make_dir(txn_root, directoryPath, subpool));

SVN_ERR(svn_repos_fs_commit_txn(NULL, c->repos, &youngest_rev, txn,
subpool));-- failed here

 

>From the debugger call stack, the code failed at the
svn_fs_fs__open_cache():

 

svn_repos_fs_commit_txn

  svn_fs_commit_txn

 svn_fs_fs__commit

svn_fs_fs__open_rep_cache

 

 

Not sure if anyone saw this before? I must have missed something, but the
code logic is too much to understand.



RE: svn_repos_fs_commit_txn error

2015-11-24 Thread Ren Wang
After more google searching, I added the following line in the begin of the 
program, it is working now:
apr_initialize();

Thanks anyway.

-Original Message-
From: Bert Huijben [mailto:b...@qqmail.nl] 
Sent: Tuesday, November 24, 2015 5:01 AM
To: 'Branko Čibej' ; users@subversion.apache.org
Subject: RE: svn_repos_fs_commit_txn error



> -Original Message-
> From: Branko Čibej [mailto:br...@apache.org]
> Sent: dinsdag 24 november 2015 06:13
> To: users@subversion.apache.org
> Subject: Re: svn_repos_fs_commit_txn error
> 
> On 23.11.2015 21:01, Ren Wang wrote:
> > I got an error for creating a new directory to the repository. Strange to me
> > is that enve the code failed at the svn_repos_fs_commit_txn, but the
> > directory got created:
> >
> >
> >
> >
> >
> > 1)  Open repository, repos
> >
> > 2)  Get the latest revision, youngest
> >
> > 3)  Do the following:
> >
> > svn_fs_txn_t *txn;
> >
> > svn_fs_root_t *txn_root;
> >
> > apr_pool_t *subpool = svn_pool_create(pool);
> >
> > SVN_ERR(svn_repos_fs_begin_txn_for_commit(&txn, &repos,
> youngest_rev,
> > "UncleYinan", "log msg", subpool));
> >
> > SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
> >
> > SVN_ERR(svn_fs_make_dir(txn_root, directoryPath, subpool));
> >
> > SVN_ERR(svn_repos_fs_commit_txn(NULL, c->repos, &youngest_rev, txn,
> > subpool));-- failed here

This may be 100% expected... see the documentation of this function.
Especially the part
[[
* A successful commit is indicated by a valid revision value in @a
 * *new_rev, not if svn_fs_commit_txn() returns an error, which can
 * occur during its post commit FS processing.  If the transaction was
 * not committed, then return the associated error and do not execute
 * the post-commit hook.
]]

For completeness I copied the documentation from svn_repos.h here:

/** Like svn_fs_commit_txn(), but invoke the @a repos' pre- and
 * post-commit hooks around the commit.  Use @a pool for any necessary
 * allocations.
 *
 * If the pre-commit hook fails, do not attempt to commit the
 * transaction and throw the original error to the caller.
 *
 * A successful commit is indicated by a valid revision value in @a
 * *new_rev, not if svn_fs_commit_txn() returns an error, which can
 * occur during its post commit FS processing.  If the transaction was
 * not committed, then return the associated error and do not execute
 * the post-commit hook.
 *
 * If the commit succeeds the post-commit hook is executed.  If the
 * post-commit hook returns an error, always wrap it with
 * SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED; this allows the caller to
 * find the post-commit hook error in the returned error chain.  If
 * both svn_fs_commit_txn() and the post-commit hook return errors,
 * then svn_fs_commit_txn()'s error is the parent error and the
 * SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped error is the child
 * error.
 *
 * @a conflict_p, @a new_rev, and @a txn are as in svn_fs_commit_txn().
 */
svn_error_t *
svn_repos_fs_commit_txn(const char **conflict_p,
svn_repos_t *repos,
svn_revnum_t *new_rev,
svn_fs_txn_t *txn,
apr_pool_t *pool);

--
Bert




Re: svn_repos_fs_commit_txn error

2015-11-24 Thread Ren Wang
Thank you so much for the information. I wonder if there is a simple or any 
subversion programming guide?

Sent from my iPhone

> On Nov 24, 2015, at 11:31, Philip Martin  wrote:
> 
> "Ren Wang"  writes:
> 
>> After more google searching, I added the following line in the begin
>> of the program, it is working now:
>> apr_initialize();
> 
> A Subversion server process should call:
> 
> apr_initialize()
> svn_dso_initialize2()
> svn_fs_initialize()
> svn_cache_config_set()
> 
> before starting to access repositories.  Subversion will attempt to
> initialize on-the-fly if these functions are not called.
> 
> -- 
> Philip Martin
> WANdisco


API for creating file and revision

2015-11-25 Thread Ren Wang
First of all, I would like to express my appreciation for the support from
the community in the past few days. 

 

Here are some more another questions:

 

The API svn_fs_make_file() will create an empty file, and the
svn_fs_apply_text() will fill the text content to the repository. Is there a
similar API for setting binary content?

 

If the file already created in the repository, what's the API to create a
revision of it?

 

Regards,

 

Ren

 

 

 

 

 

 

 



getting file or directory property/metadata

2015-11-26 Thread Ren Wang
How to get a file or directory property by using API, is it
svn_fs_node_prop()? I was trying to get svn:author (a default property) for
a file from the repository, but the API always returns NULL.

 



FW: getting file or directory property/metadata

2015-11-27 Thread Ren Wang
Thanks, that makes sense.

Here is another question. How to get the latest revision id for a node? I see 
the svnlook is calling svn_fs_node_id() to get node id, but couldn't find a 
reference to get the latest revision of id for a node.

>From the subversion client side, I can see the latest version id showing on 
>the subversion client panel, such as on TortoseSVN, I guess it must has an 
>interface on the repos or fs layer.

-Original Message-
From: Branko Čibej [mailto:br...@apache.org]
Sent: Thursday, November 26, 2015 11:13 AM
To: Ren Wang 
Subject: Re: getting file or directory property/metadata

There have been two kinds of properties in Subversion since before 1.0. :)

A transacton property is like a revision property, but belongs to a transaction 
object, which may, when committed, become a new revision. We use transactions 
to build up tree and content changes, then commit them (which is a complex 
process) to create new revisions. At any time, there can be an number of open 
transactions; but only one revision at a time can be committed.

-- Brane

On 26.11.2015 16:01, Ren Wang wrote:
> BTW, what's transaction property? I noticed there is another API called:
> svn_fs_txn_prop()
>
> -Original Message-
> From: Ren Wang [mailto:renwang...@gmail.com]
> Sent: Thursday, November 26, 2015 9:58 AM
> To: 'Branko Čibej' 
> Subject: RE: getting file or directory property/metadata
>
> Thanks again. Glad to know there're two kinds of properties in subversion now.
>
> -Original Message-
> From: Branko Čibej [mailto:br...@apache.org]
> Sent: Thursday, November 26, 2015 9:47 AM
> To: users@subversion.apache.org
> Subject: Re: getting file or directory property/metadata
>
> On 26.11.2015 15:32, Ren Wang wrote:
>> How to get a file or directory property by using API, is it 
>> svn_fs_node_prop()? I was trying to get svn:author (a default
>> property) for a file from the repository, but the API always returns NULL.
> You already got the answer to that question in a previous response:
> svn:author is a *revision* property, not a *node* property. You should be 
> looking at the properties for the revision in which the file was last changed.
>
> -- Brane
>
>





RE: FW: getting file or directory property/metadata

2015-11-28 Thread Ren Wang
Thank you, svn_fs_node_created_rev() is what I am looking for.

-Original Message-
From: Branko Čibej [mailto:br...@apache.org] 
Sent: Saturday, November 28, 2015 7:07 PM
To: users@subversion.apache.org
Subject: Re: FW: getting file or directory property/metadata

On 28.11.2015 18:26, Daniel Shahaf wrote:
> To be fair, though, the same trick with 'svn info' would have lead you 
> to svn_fs_node_created_rev(), which is documented to return "the 
> revision in which @a path under @a root was created", but in fact 
> returns the revision in which it was last modified.

The docstring is correct, but it's not clear that "path under root"
means "node-revision identified by path under root". This is one of the many 
places where the DAG storage model leaks into public API semantics; what you 
get is literally the revision number in with the node-revision object was 
created.

-- Brane




RE: FW: getting file or directory property/metadata

2015-11-28 Thread Ren Wang
Thank you for the response. I just did a test, svn_fs_node_created_rev()
works great!

-Original Message-
From: Daniel Shahaf [mailto:d...@daniel.shahaf.name] 
Sent: Saturday, November 28, 2015 12:41 PM
To: Ren Wang ; d...@subversion.apache.org
Cc: users@subversion.apache.org
Subject: Re: FW: getting file or directory property/metadata

[moving to dev@; please drop users@ from replies]

Daniel Shahaf wrote on Sat, Nov 28, 2015 at 17:26:52 +:
> To be fair, though, the same trick with 'svn info' would have lead you 
> to svn_fs_node_created_rev(), which is documented to return "the 
> revision in which @a path under @a root was created", but in fact 
> returns the revision in which it was last modified.

I think the first sentence of the following docstring is wrong:

/** Set @a *revision to the revision in which @a path under @a root was
 * created.  Use @a pool for any temporary allocations.  @a *revision
will
 * be set to #SVN_INVALID_REVNUM for uncommitted nodes (i.e. modified
nodes
 * under a transaction root).  Note that the root of an unmodified
transaction
 * is not itself considered to be modified; in that case, return the
revision
 * upon which the transaction was based.
 */
svn_error_t *
svn_fs_node_created_rev(svn_revnum_t *revision,

It sounds as though it gives the answer to `svn log --stop-on-copy
--limit=1 -r 0:HEAD path@root`, but in fact it gives the "Last Changed
Revision" of path@root.

I think we need at least this patch:

Index: subversion/include/svn_fs.h
===
--- subversion/include/svn_fs.h (revision 1717002)
+++ subversion/include/svn_fs.h (working copy)
@@ -1775,2 +1775,2 @@
-/** Set @a *revision to the revision in which @a path under @a root was
- * created.  Use @a pool for any temporary allocations.  @a *revision
will
+/** Set @a *revision to the revision in which @a path under @a root was
last
+ * modified.  Use @a pool for any temporary allocations.  @a *revision
will

I didn't check the sibling functions for analogous docstring bugs.

I can't commit this myself due to an outstanding issue with my apache
account :-(

Cheers,

Daniel



subversion export with node and revision properties

2015-12-07 Thread Ren Wang
Is there a tool to export a subversion repository with node and revision
properties/metadata?



RE: subversion export with node and revision properties

2015-12-07 Thread Ren Wang
Not sure how svnadmin dump works, does it export files/directory as svn
export, plus metadata information for file/directory?

 

 

From: jbl...@icloud.com [mailto:jbl...@icloud.com] 
Sent: Monday, December 7, 2015 2:39 PM
To: Subversion Users 
Cc: Ren Wang 
Subject: Re: subversion export with node and revision properties

 

 

On Dec 7, 2015, at 12:28 PM, Ren Wang mailto:renwang...@gmail.com> > wrote:

 

Is there a tool to export a subversion repository with node and revision
properties/metadata?

 

 

You mean like "svnadmin dump"?

 

 

 

 



node unique id

2016-01-21 Thread Ren Wang
Can I assume the node revision id is unique in subversion? If so, is there
an API to get it by repository root, path and revision number parameters?

 

Regards,

 

Ren



RE: node unique id

2016-01-21 Thread Ren Wang
Hi Stefan,

Thank you very much for the response. The purpose is to the uniquely
identify a file for a specific revision or the latest revision. 

What can I do if the file didn't change for a specified revision, then I
will need to get the latest revision number for the file, is there a API to
get the latest  revision for a node?

Regards,

Ren

-Original Message-
From: Stefan Sperling [mailto:s...@elego.de] 
Sent: Thursday, January 21, 2016 11:01 AM
To: Ren Wang 
Cc: 'Subversion Users' 
Subject: Re: node unique id

On Thu, Jan 21, 2016 at 10:25:09AM -0500, Ren Wang wrote:
> Can I assume the node revision id is unique in subversion?

Yes, but it is specific to a particular filesystem instance.
If you dump/load the repository all IDs will change.

> If so, is there
> an API to get it by repository root, path and revision number parameters?

svn_fs_paths_changed2() declared in include/subversion/svn_fs.h provides the
IDs for changed paths in a particular revision.

An ID is represented as an opaque object svn_fs_id_t.
The contents of this object depend on the filesystem backend used.
There are a few functions to operate on svn_fs_id_t, such as
svn_fs_unparse_id(). 

It's unclear what purpose you'd like to use these for so it's hard to give
more specific advice.



version number

2016-02-21 Thread Ren Wang
Is there a way or API to set and get a file version number instead of
revision number? For my case, when a file is created, the version by default
should be 1, every change the version number will be incremented by 1.

 

Regards,

 

Ren

 

 



RE: version number

2016-02-21 Thread Ren Wang
Hi Andreas,

Thank you so much for the answer!

Ren

-Original Message-
From: Andreas Mohr [mailto:a...@lisas.de] 
Sent: Sunday, February 21, 2016 9:40 AM
To: Ren Wang 
Cc: users@subversion.apache.org
Subject: Re: version number

On Sun, Feb 21, 2016 at 08:45:56AM -0500, Ren Wang wrote:
>Is there a way or API to set and get a file version number instead of
>revision number? For my case, when a file is created, the version by
>default should be 1, every change the version number will be 
> incremented

Generally spoken this is a pretty simple matter:

[number of log entries for this file] == "version number"

Since your requirement is compatible enough that the number of log entries
directly corresponds to the version number, we now at least know that there
is no *extra* state data needed which would need to be stored in database
area.


As an svn semi-expert (insufficiently informed since SvnBridge devel), I
don't know which particular APIs might be available to retrieve this
information in the most direct/efficient manner, though.
You are likely looking for something
which directly returns a shallow "number of log entries"
rather than deep (per-entry) log information...

HTH,

Andreas Mohr



svn_fs for rename file and folder

2016-02-21 Thread Ren Wang

Are there APIs for renaming file/folder in the svn_fs layer?

Regards,

Ren



RE: svn_fs for rename file and folder

2016-02-21 Thread Ren Wang
Hi Bert,

 

Thank you very much, the copies+delete works for me.

 

Ren

 

From: Bert Huijben [mailto:b...@qqmail.nl] 
Sent: Sunday, February 21, 2016 3:51 PM
To: Ren Wang ; users@subversion.apache.org
Subject: RE: svn_fs for rename file and folder

 

Currently not.  We still express moves as copies+delete.

(There is some experimental support hidden in the implementations, but that 
isn’t used yet)

 

Bert

 

Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986>  for Windows 10

 

From: Ren Wang <mailto:renwang...@gmail.com> 
Sent: zondag 21 februari 2016 16:44
To: users@subversion.apache.org <mailto:users@subversion.apache.org> 
Subject: svn_fs for rename file and folder

 

 

Are there APIs for renaming file/folder in the svn_fs layer?

 

Regards,

 

Ren

 

 



rollback to previous revision

2016-02-21 Thread Ren Wang
How to rollback of a file or folder to previous revision? I can't find it
from the command tool or API, is there a API for it?

 

Regards,

 

Ren



RE: rollback to previous revision

2016-02-22 Thread Ren Wang
Maybe I didn't describe it clearly. 

I mean to rollback on the repository instead of the working copy. If a user 
checked in a "wrong" file, system administrator/project manager needs to 
rollback the file to the previous revision on the repository.

-Original Message-
From: Stefan Hett [mailto:ste...@egosoft.com] 
Sent: Monday, February 22, 2016 6:28 AM
To: users@subversion.apache.org
Subject: Re: rollback to previous revision

Hi,
> Hello,
>   
>> How to rollback of a file or folder to previous revision?
> svn merge -rHEAD:PREV TARGET
>
> Andreas
Or svn up -r [file/folder] if by "rollback" you mean to get an older 
revision of a file/folder instead of reverting changes done to the file.

--
Regards,
Stefan Hett, Developer/Administrator

EGOSOFT GmbH, Heidestrasse 4, 52146 Würselen, Germany
Tel: +49 2405 4239970, www.egosoft.com
Geschäftsführer: Bernd Lehahn, Handelsregister Aachen HRB 13473