views:

30

answers:

2

Hello,

I have svn repository with project on it. Right now there is "good" version and on my computer there is "bad" version but I want to have both on repository.

I dont want to make any tags. I can rememebr that I once did somethinkg like that:

Commited "bad" version, then checked out old but "good" version and commited it so that "good" version is on svn and "bad" version as well as older revision.

But now when I do that and try to commit "good" version there is a message that there are no changes.

Changes which were made are: adding some code to files never deleting any code.

What is the best way to do sth like that ?

A: 

create a branch of your project. Put there the bad version.

Jose Conde
+1  A: 

Merge the old (good) version into last (bad) one.

$ svn help merge
merge: Apply the differences between two sources to a working copy path.
usage:
1. merge sourceURL1[@N] sourceURL2[@M] [WCPATH]
2. merge sourceWCPATH1@N sourceWCPATH2@M [WCPATH]
3. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [WCPATH]

  1. In the first form, the source URLs are specified at revisions N and M. These are the two sources to be compared. The revisions default to HEAD if omitted.

  2. In the second form, the URLs corresponding to the source working copy paths define the sources to be compared. The revisions must be specified.

  3. In the third form, SOURCE can be either a URL or a working copy path (in which case its corresponding URL is used). SOURCE (in revision REV) is compared as it existed between revisions N and M for each revision range provided. If REV is not specified, HEAD is assumed. '-c M' is equivalent to '-r :M', and '-c -M' does the reverse: '-r M:'. If no revision ranges are specified, the default range of 0:REV is used. Multiple '-c' and/or '-r' options may be specified, and mixing of forward and reverse ranges is allowed.

In your case you could use form 3:

svn merge -r HEAD:PREV .

merging previous version into head version of the working copy

Dmitry Yudakov