We're running out of patch versions here ...
gstein pointed out that I should use SVN_IS_VALID_REVNUM(). Fixed!
On Fri, Apr 02, 2010 at 10:59:15AM +0200, Daniel Näslund wrote:
> Mispelled Uncommitted with one 't'. This patch corrects that.
>
> On Fri, Apr 02, 2010 at 10:36:53AM +0200, Daniel Näslund wrote:
> > On Tue, Mar 30, 2010 at 11:04:13PM +0200, Stefan Sperling wrote:
> > > On Tue, Mar 30, 2010 at 10:14:42PM +0200, Daniel Näslund wrote:
> > > > Ping! This patch has not been reviewed!
> > > >
> > > > On Sun, Mar 14, 2010 at 09:38:15PM +0100, Daniel Näslund wrote:
> > > > > Hi!
> > > > >
> > > > > The 1.6 svnversion message was "'path' not versioned, and not
> > > > > exported".
> > > > > But on trunk more than one message has been changed. My first thought
> > > > > was that we should be backward compat in our output but if changes of
> > > > > those messages are ok I'm supplying one.
> > > > >
> > > > > In case we will use new messages, the help text must be updated. It
> > > > > talks of 'exported' but those are not used in the new messages.
> > > > >
> > > > > [[[
> > > > > After the changes in r922176, versioned but not yet committed files
> > > > > were
> > > > > not properly detected. Fixed now!
> > > > >
> > > > > * subversion/svnversion/main.c
> > > > > (main): Check for invalid rev nr for files and dirs.
> > > > >
> > > > > * subversion/tests/cmdline/svnversion_tests.py
> > > > > (structural_changes): New.
> > > > > (tests_list): Add new test.
> > > > > ]]]
Index: subversion/tests/cmdline/svnversion_tests.py
===================================================================
--- subversion/tests/cmdline/svnversion_tests.py (revision 930183)
+++ subversion/tests/cmdline/svnversion_tests.py (working copy)
@@ -236,7 +236,36 @@ def svnversion_with_excluded_subtrees(sbox):
svntest.actions.run_and_verify_svnversion("working copy with excluded file",
D_path, repo_url + '/A/D',
[ "1P\n" ], [])
+def structural_changes(sbox):
+ "test 'svnversion' with structural changes"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ repo_url = sbox.repo_url
+ iota_path = os.path.join(wc_dir, 'iota')
+ iota_copy_path = os.path.join(wc_dir, 'iota_copy')
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'cp', iota_path, iota_copy_path)
+
+ svntest.actions.run_and_verify_svnversion("Copied file",
+ iota_copy_path, repo_url +
+ '/iota_copy',
+ [ "Local uncommitted "
+ "modifications, no revision "
+ "information found\n" ], [])
+ C_path = os.path.join(wc_dir, 'A', 'C')
+ C_copy_path = os.path.join(wc_dir, 'C_copy')
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'cp', C_path, C_copy_path)
+
+ svntest.actions.run_and_verify_svnversion("Copied dir",
+ C_copy_path, repo_url +
+ '/C_copy',
+ [ "Local uncommitted "
+ "modifications, no revision "
+ "information found\n" ], [])
+
########################################################################
# Run the tests
@@ -246,6 +275,7 @@ test_list = [ None,
svnversion_test,
ignore_externals,
svnversion_with_excluded_subtrees,
+ structural_changes,
]
if __name__ == '__main__':
Index: subversion/svnversion/main.c
===================================================================
--- subversion/svnversion/main.c (revision 930183)
+++ subversion/svnversion/main.c (working copy)
@@ -290,6 +290,16 @@ main(int argc, const char *argv[])
return EXIT_FAILURE;
}
+ if (SVN_IS_VALID_REVNUM(res->min_rev))
+ {
+ /* Local uncommited modifications, no revision info was found. */
+ SVN_INT_ERR(svn_cmdline_printf(pool, _("Uncommitted local addition "
+ "copy, or move%s"),
+ no_newline ? "" : "\n"));
+ svn_pool_destroy(pool);
+ return EXIT_SUCCESS;
+ }
+
/* Build compact '123[:456]M?S?' string. */
SVN_INT_ERR(svn_cmdline_printf(pool, "%ld", res->min_rev));
if (res->min_rev != res->max_rev)