author | Jonathan Nieder <jrnieder@gmail.com> | |
Sat, 20 Nov 2010 00:51:50 +0000 (18:51 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Nov 2010 22:51:43 +0000 (14:51 -0800) | ||
commit | 08c39b5c44449cb649ac32274e27be8046e373d4 | |
tree | 0a0fb6bf053c26a2621a6ea25fb12ce50d804aae | tree | snapshot |
parent | 6ee4a9be48ee714ddacf313a7073dabdd6c6ee11 | commit | diff |
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>
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>
vcs-svn/repo_tree.c | diff | blob | history | |
vcs-svn/repo_tree.h | diff | blob | history | |
vcs-svn/svndump.c | diff | blob | history |