vcs-svn: Combine repo_replace and repo_modify functions
commit89a2f3b9052dbd4bace3e31da87cf1fd95bd4f6f
authorJonathan Nieder <jrnieder@gmail.com>
Sat, 20 Nov 2010 00:51:50 +0000 (19 18:51 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Nov 2010 22:51:43 +0000 (24 14:51 -0800)
tree47329598cc8f047eecfa8a93949822b0e6d94597
parente540a3784fde5cc500b31207200a226be3441fd1
vcs-svn: Combine repo_replace and repo_modify functions

There are two functions to change the staged content for a path in the
svn importer's active commit: repo_replace, which changes the text and
returns the mode, and repo_modify, which changes the text and mode and
returns nothing.

Worse, there are more subtle differences:

 - A mark of 0 passed to repo_modify means "use the existing content".
   repo_replace uses it as mark :0 and produces a corrupt stream.

 - When passed a path that is not part of the active commit,
   repo_replace returns without doing anything.  repo_modify
   transparently adds a new directory entry.

Get rid of both and introduce a new function with the best features of
both: repo_modify_path modifies the mode, content, or both for a path,
depending on which arguments are zero.  If no such dirent already
exists, it does nothing and reports the error by returning 0.
Otherwise, the return value is the resulting mode.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
repo_tree.c
repo_tree.h
svndump.c