On Wed, Jan 13, 2010 at 17:02, Headley, Ronald (PSC/ISMS/EAD-CTR)
<Ronald.Headley_at_psc.hhs.gov> wrote:
> Good evening.
>
>
>
> We recently encountered an issue where an incorrect version, or more
> specifically, a non-existing version, of a file was promoted to production.
> We want to enhance our process to ensure we, at a minimal, export an
> existing version of a file. Can anyone suggest a command that will check
> the file version (without parsing the output of the list command; I’d rather
> check the execution of the command with “echo $?” or something to that
> effect)? See examples below for further details.
>
Use svn info. svn list really seems like the wrong tool for the job
here. You'll still have to parse the output of svn info to read the
Last Changed Revision line.
>
> In this example, we execute a list on a file for a specific version. As you
> can see, the list succeeded.
>
>
>
> $ svn list -r42 -v
> svn://<server>.<xxx>.<yyy>.<zzz>:000/Repository/<filename>
>
> 42 <username> 540672 Feb 17 2009 <filename>
>
> $ echo $?
>
> 0
>
>
>
> In this example, we execute a list on a file for a specific version. As you
> can see, the list succeeded. However, we hoped it would fail since the only
> version of the file is 42.
Why would you expect it to fail? You asked for svn ls as of revision
42, and the file existed at that revision.
>
> $ svn list -r61 -v
> svn://<server>.<xxx>.<yyy>.<zzz>:000/Repository/<filename>
>
> 42 <username> 540672 Feb 17 2009 <filename>
>
> $ echo $?
>
> 0
If the file hasn't been changed since r42, this still seems correct.
Received on 2010-01-14 00:24:40 CET