Hi,
I think I found a subtle difference for outputting XML formatted data from
svn info and status. I'm on Win7, SVN 1.8.5 (r1542147).
svn status when generating <entry path=> tags does not seem to care about
your current working directory (CWD) relative to the requested path. It
always appears to return an absolute file path.
svn info returns different path depending on if the WC path requested is
within the EXACT spelling of the CWD. When your requested path is within
the enclosing CWD, it will return relative paths and absolute otherwise.
If the requested path spelling is equivalent (for Win systems any how), it
will only return relative for exact spelling. Changing the case of a
directory will change it to absolute. It appears there may be other ways
to get relative vs absolute with info but I couldn't repeat reliably.
It would be nice if SVN would always return an absolute path consistent
with the status command. This would also solve the case where Win paths
are case insensitive and equivalent paths return different results. It
would also be good as generally when using --xml, you are using some
automated tool or application and do not always know or control what the
CWD is (especially for Win apps). Additionally, the path that the entry
is relative to is not the WC but the CWD. This makes grabbing an XML file
later and making sense of it impossible (since the CWD is not embedded
within the XML file) -- see third example below.
I'm not sure if this is considered operating as-design, and therefore an
enhancement request, or if it is a bug.
I appreciate your time!
Thanks
Dan
Here's an example... This first call is using a case-different path from
what the CWD is (note the project_files vs Project_files). It returned an
absolute path. The second returned relative paths (exact spelling match).
The third is showing the relative paths are not relative to a WC, but
relative to the CWD.
c:\Project_files\LocalSVN>svn info
"c:\project_files\LocalSVN\trunk\info_test" --depth immediates --xml
<?xml version="1.0" encoding="UTF-8"?>
<info>
<entry
path="C:\project_files\LocalSVN\trunk\info_test"
revision="5"
kind="dir">
(Snipped)
</entry>
<entry
path="C:\project_files\LocalSVN\trunk\info_test\foo.bar"
revision="6"
kind="file">
(Snipped)
</entry>
</info>
c:\Project_files\LocalSVN>svn info
"c:\Project_files\LocalSVN\trunk\info_test" --depth immediates --xml
<?xml version="1.0" encoding="UTF-8"?>
<info>
<entry
kind="dir"
path="trunk\info_test"
revision="5">
(Snipped)
</entry>
<entry
path="trunk\info_test\foo.bar"
revision="6"
kind="file">
(Snipped)
</entry>
</info>
c:\>svn info "c:\Project_files\LocalSVN\trunk\info_test" --depth
immediates --xml
<?xml version="1.0" encoding="UTF-8"?>
<info>
<entry
path="Project_files\LocalSVN\trunk\info_test"
revision="5"
kind="dir">
(Snipped)
<entry
path="Project_files\LocalSVN\trunk\info_test\foo.bar"
revision="6"
kind="file">
(Snipped)
</entry>
</info>
Received on 2014-01-24 22:31:49 CET