You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by HuiHuang <ye...@yahoo.com.cn> on 2009/06/22 13:34:01 UTC
weekly report for 2009-06-15~2009-06-20
Hey Stefan,
This week:
1. Because function svn_client_commit4() is too long, so I divide it into 3
functions:
svn_client_commit4(), this function calls svn_client_collect_commit_packet()
to collect commit items and do commit at last. It updates wcs, too.
It corresponds to 1), 5), 6), 7) points in
subversion\notes\commit-from-multiple-working-copies.txt
svn_client_collect_commit_packet(), this function group the targets by wc,
and collect commit_items and lock_tokens for every repository.
It corresponds to 2), 3), 4) points in
subversion\notes\commit-from-multiple-working-copies.txt
svn_client_create_wc_access(), this function create wc_access for
each working copy. It corresponds to 3) point in
subversion\notes\commit-from-multiple-working-copies.txt
I have finished the coding of svn_client_collect_commit_packet() and
svn_client_create_wc_access(), but not tested them.
problem:
1. I write a new function svn_wc__find_wc_root(), but how should I test it
independently?
2. how can I view content of variables except using SVN_ERR_ASSERT()?
how can I output internal result to see whether it runs as expect?
next week:
1. write code.
Best Regards!
Huihuang
--------------
yellow.flying
2009-06-22
__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2364161
Re: weekly report for 2009-06-15~2009-06-20
Posted by HuiHuang <ye...@yahoo.com.cn>.
>Huihuang, if I may, I'd like to expand on this just a bit for your sake and
>the sake of others who might be reading.
>Subversion's code and headers files are segregated along a couple of key
>lines: module-specific/inter-module and public/private. This separation is
Thanks C. Michael Pilato, this will help me a lot~
------------------
yellow.flying
2009-06-23
__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2364355
Re: weekly report for 2009-06-15~2009-06-20
Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Sperling wrote:
> On Mon, Jun 22, 2009 at 12:28:20PM -0400, C. Michael Pilato wrote:
>> I hope this helps. (And better still, I hope I've provided something that
>> the other devs would agree with. If so, maybe we can toss this text into
>> hacking.html for the benefit of future others.)
>
> +1, please add it to hacking.
Done.
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2364249
Re: weekly report for 2009-06-15~2009-06-20
Posted by Stefan Sperling <st...@elego.de>.
On Mon, Jun 22, 2009 at 12:28:20PM -0400, C. Michael Pilato wrote:
> I hope this helps. (And better still, I hope I've provided something that
> the other devs would agree with. If so, maybe we can toss this text into
> hacking.html for the benefit of future others.)
+1, please add it to hacking.
Stefan
Re: weekly report for 2009-06-15~2009-06-20
Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Sperling wrote:
> Why is svn_client_collect_commit_packet() public?
>
> Making the function public means that it can be called from outside
> of libsvn_client. I don't think we need it to be public. It's enough
> to have the public function svn_client_commit4(), isn't it?
>
> I think svn_client_collect_commit_packet can be local to the file
> it is being used in (i.e. call it just collect_commit_packet and
> mark the function as static).
Huihuang, if I may, I'd like to expand on this just a bit for your sake and
the sake of others who might be reading.
Subversion's code and headers files are segregated along a couple of key
lines: module-specific/inter-module and public/private. This separation is
done primarily because of our focus on proper modularity and code
organization, but also because of our promises as providers and maintainers
of a widely adopted public API. As you write new functions in Subversion,
you'll need to carefully consider these things, asking some questions of
yourself as you go along:
"Are the consumers of my new code local to a particular source code file
in a single module?" If so, you probably want a static function
in that same source file.
"Is my new function of the sort that other source code within this
module will need to use, but nothing *outside* the module?" If so,
you want to use a non-static, double-underscore-named function (such
as svn_wc__do_something), with its prototype in the appropriate
module-specific header file.
"Will my code need to be accessed from a different module?" Here you
have some additional questions to answer, such as "Should my code
live in the original module I was going to put it in, or should it
live in a more generic utility library such as libsvn_subr?" Either
way, you're now looking at using an inter-module header file. But
see the next question before you decide which one...
"Is my code such that it has a clean, maintainable API that can
reasonably be maintained in perpetuity and brings value to the
Subversion public API offering?" If so, you'll be adding
prototypes to the public API, immediately inside subversion/include/.
If not, double-check your plans -- maybe you haven't chosen the best
way to abstract your functionality. But sometimes it just happens
that modules need to share some function that is arguably of no use
to other software besides Subversion itself. In those cases, use
the private header files in subversion/include/private/.
I hope this helps. (And better still, I hope I've provided something that
the other devs would agree with. If so, maybe we can toss this text into
hacking.html for the benefit of future others.)
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2364212
Re: weekly report for 2009-06-15~2009-06-20
Posted by Stefan Sperling <st...@elego.de>.
On Mon, Jun 22, 2009 at 09:34:01PM +0800, HuiHuang wrote:
> Hey Stefan,
>
> This week:
> 1. Because function svn_client_commit4() is too long, so I divide it into 3
> functions:
> svn_client_commit4(), this function calls svn_client_collect_commit_packet()
> to collect commit items and do commit at last.
> It updates wcs, too.
OK.
> It corresponds to 1), 5), 6), 7) points in
> subversion\notes\commit-from-multiple-working-copies.txt
>
> svn_client_collect_commit_packet(), this function group the targets by wc,
> and collect commit_items and lock_tokens for every repository.
> It corresponds to 2), 3), 4) points in
> subversion\notes\commit-from-multiple-working-copies.txt
Why is svn_client_collect_commit_packet() public?
Making the function public means that it can be called from outside
of libsvn_client. I don't think we need it to be public. It's enough
to have the public function svn_client_commit4(), isn't it?
I think svn_client_collect_commit_packet can be local to the file
it is being used in (i.e. call it just collect_commit_packet and
mark the function as static).
Please see http://subversion.tigris.org/hacking.html#other-conventions
the paragraph starting with "All published functions, variables, and
structures must be signified with the corresponding library name ..."
> svn_client_create_wc_access(), this function create wc_access for
> each working copy. It corresponds to 3) point in
> subversion\notes\commit-from-multiple-working-copies.txt
OK. But same question: Why is this a public function?
> I have finished the coding of svn_client_collect_commit_packet() and
> svn_client_create_wc_access(), but not tested them.
Sounds good! Can you attach a patch of your current work?
Even if it's not finished yet we could still review it!
> problem:
> 1. I write a new function svn_wc__find_wc_root(), but how should I test it
> independently?
Write a new unit test in tests/libsvn_wc/
> 2. how can I view content of variables except using SVN_ERR_ASSERT()?
> how can I output internal result to see whether it runs as expect?
Run Subversion in a debugger. On Linux, I use gdb. I don't know what
good debugger for Windows is. Anyone?
Thanks,
Stefan