You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Headley, Ronald (PSC/ISMS/EAD-CTR)" <Ro...@PSC.hhs.gov> on 2010/01/13 22:02:20 UTC

Verifying a file version

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.

 

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.

 

$ svn list -r61 -v
svn://<server>.<xxx>.<yyy>.<zzz>:000/Repository/<filename>

     42 <username>       540672 Feb 17  2009 <filename>

$ echo $?

0

 

In this example, we again execute a list on a file for a specific
version.  This time the version exceeded the highest versioned directory
tree, which is 61.

 

$ svn list -r65 -v
svn://<server>.<xxx>.<yyy>.<zzz>:000/Repository/<filename>

svn: No such revision 65

$ echo $?

1

 

Thank you,

 

Ron Headley
Contractor 
HHS/PSC/ISMS/ESS PMO (Program Management Office)

(a SDVOSB)
301-525-3801 (cell)

 


Re: Verifying a file version

Posted by Andy Levy <an...@gmail.com>.
On Thu, Jan 14, 2010 at 11:30, Headley, Ronald (PSC/ISMS/EAD-CTR)
<Ro...@psc.hhs.gov> wrote:
> Thanks Andy.  We really want to work with a file version, or revision, as opposed to a tree revision.   Suppose there are three revisions of File-1 in the repository and one revision of File-2.
>
> File-1 revision 63
> File-1 revision 64
> File-2 revision 65
> File-1 revision 66
>
> Suppose we want to deploy File-1 revision 66 but the developer specifies revision 65 (which doesn't exist) when creating the deployment package (HP Kintana).  In this scenario, File-1 revision 64 will be exported and deployed.  This is what happened and is what we want to avoid.  Do you have any suggestions?
>
> Perhaps the wrong tool was selected or perhaps it is not setup correctly or we're not using it correctly.  Either way, it is what we have to work with and we're trying to improve our processes.  We're also looking at establishing baselines for our systems using SVN.  Can this be done?

Subversion doesn't have "file revisions." Revision 65 *does* exist,
and File-1 *does* exist in that revision - it just wasn't changed
then, so it looks identical to File-1 in revision 64.

Each revision number represents the state of the entire repository at
that moment in time. If File-1 wasn't changed in revision 65, File-1 @
r65 will look identical to File-1 @ r64.

Re: Verifying a file version

Posted by Andy Levy <an...@gmail.com>.
On Thu, Jan 14, 2010 at 11:30, Headley, Ronald (PSC/ISMS/EAD-CTR)
<Ro...@psc.hhs.gov> wrote:
> Thanks Andy.  We really want to work with a file version, or revision, as opposed to a tree revision.   Suppose there are three revisions of File-1 in the repository and one revision of File-2.
>
> File-1 revision 63
> File-1 revision 64
> File-2 revision 65
> File-1 revision 66
>
> Suppose we want to deploy File-1 revision 66 but the developer specifies revision 65 (which doesn't exist) when creating the deployment package (HP Kintana).  In this scenario, File-1 revision 64 will be exported and deployed.  This is what happened and is what we want to avoid.  Do you have any suggestions?
>
> Perhaps the wrong tool was selected or perhaps it is not setup correctly or we're not using it correctly.  Either way, it is what we have to work with and we're trying to improve our processes.  We're also looking at establishing baselines for our systems using SVN.  Can this be done?

Subversion doesn't have "file revisions." Revision 65 *does* exist,
and File-1 *does* exist in that revision - it just wasn't changed
then, so it looks identical to File-1 in revision 64.

Each revision number represents the state of the entire repository at
that moment in time. If File-1 wasn't changed in revision 65, File-1 @
r65 will look identical to File-1 @ r64.

>From your description (but I'm having a hard time understanding what
you're trying to achieve), Subversion may not be the right tool for
your requirements, or may require some significant layering of other
programs/scripts on top of it to get it to do what you want.

A "complex tag" may get you closer to where you want to be. See
http://svnbook.red-bean.com/en/1.5/svn.branchmerge.tags.html#svn.branchmerge.tags.mkcomplex

Not sure what you're trying to do with "baselines" - is this for
detecting changes to items in (for example) a production environment?
That would be a better task for something like Tripwire.

RE: Verifying a file version

Posted by Bob Archer <Bo...@amsi.com>.
> Thanks Andy.  We really want to work with a file version, or revision, as
> opposed to a tree revision.   Suppose there are three revisions of File-1
> in the repository and one revision of File-2.
> 
> File-1 revision 63
> File-1 revision 64
> File-2 revision 65
> File-1 revision 66
> 
> Suppose we want to deploy File-1 revision 66 but the developer specifies
> revision 65 (which doesn't exist) when creating the deployment package (HP

Sure it exists... the file in rev65 is the same one as in rev64. I'm not sure why you wouldn't deploy using all the files in a specific rev? 

One thing we do, which may be what you are looking for is put dependencies in the repository. So, in our lib folder we have version X of log4net.dll. This is allways used to build the deployment. If the devs decide to start using version x.1 they would update the binary in the lib folder.

> Kintana).  In this scenario, File-1 revision 64 will be exported and
> deployed.  This is what happened and is what we want to avoid.  Do you
> have any suggestions?

Subversion doesn't really work this way. You can basically ask for the file as it was in rev x. It may be the same in many revs of course. 

> Can anyone suggest a command that will check the file version

You can use a tool like SubWCRev Program from the Tortoise project which will tag the header with the latest version that a file was modified in.

BOb

RE: Verifying a file version

Posted by "Headley, Ronald (PSC/ISMS/EAD-CTR)" <Ro...@PSC.hhs.gov>.
Thanks Andy.  We really want to work with a file version, or revision, as opposed to a tree revision.   Suppose there are three revisions of File-1 in the repository and one revision of File-2.

File-1 revision 63
File-1 revision 64
File-2 revision 65
File-1 revision 66

Suppose we want to deploy File-1 revision 66 but the developer specifies revision 65 (which doesn't exist) when creating the deployment package (HP Kintana).  In this scenario, File-1 revision 64 will be exported and deployed.  This is what happened and is what we want to avoid.  Do you have any suggestions?

Perhaps the wrong tool was selected or perhaps it is not setup correctly or we're not using it correctly.  Either way, it is what we have to work with and we're trying to improve our processes.  We're also looking at establishing baselines for our systems using SVN.  Can this be done?

Any suggestions would be greatly appreciated.

Ron Headley
Contractor 
HHS/PSC/ISMS/ESS PMO (Program Management Office)
(a SDVOSB)
301-525-3801 (cell)

-----Original Message-----
From: Andy Levy [mailto:andy.levy@gmail.com] 
Sent: Wednesday, January 13, 2010 6:24 PM
To: Headley, Ronald (PSC/ISMS/EAD-CTR)
Cc: users@subversion.apache.org
Subject: Re: Verifying a file version

On Wed, Jan 13, 2010 at 17:02, Headley, Ronald (PSC/ISMS/EAD-CTR)
<Ro...@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.


Re: Verifying a file version

Posted by Andy Levy <an...@gmail.com>.
On Wed, Jan 13, 2010 at 17:02, Headley, Ronald (PSC/ISMS/EAD-CTR)
<Ro...@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.

RE: Verifying a file version

Posted by "Headley, Ronald (PSC/ISMS/EAD-CTR)" <Ro...@PSC.hhs.gov>.
Thanks Ryan.  Parsing the output really isn't a big deal.  I guess I was
hoping for a more eloquent solution.

Any suggested reading for SVN?  Specifically, we're looking at
establishing baselines for our systems using SVN.  Can this be done
using this tool?

Ron Headley
Contractor 
HHS/PSC/ISMS/ESS PMO (Program Management Office)
(a SDVOSB)
301-525-3801 (cell)

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2010a@ryandesign.com] 
Sent: Wednesday, January 13, 2010 6:24 PM
To: Headley, Ronald (PSC/ISMS/EAD-CTR)
Cc: users@subversion.apache.org
Subject: Re: Verifying a file version


On Jan 13, 2010, at 16:02, Headley, Ronald (PSC/ISMS/EAD-CTR) wrote:

> 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.

To correct the terminology, you're trying to verify the "last changed
revision" of the file. And I don't think you're going to find a solution
that doesn't involve parsing the output of some svn command.




Re: Verifying a file version

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 13, 2010, at 16:02, Headley, Ronald (PSC/ISMS/EAD-CTR) wrote:

> 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.

To correct the terminology, you're trying to verify the "last changed revision" of the file. And I don't think you're going to find a solution that doesn't involve parsing the output of some svn command.