0

I'm going mental here.

I'm writing code for my Ph.D. project(s). I have two versions of a specific .cpp file and I want to use them both (alternating between them). I want to keep the most updated version of the other files.

I tried using svn copy but it won't run over existing file. I tried to delete the file but svn copy will just, kindly, say that it won't write over files existing in the repository even if they are missing in the target folder. Apart from checking out the entire version to a separate directory and copying the file manually to the desired folder, how can I revert a single file in my local folder to a previous version?

I don't want to update the entire tree, simply the local copy.

Alternatively, is there other version control system that can work over ssh and will give me this feature?

Thanks

Yotam
  • 10,295
  • 30
  • 88
  • 128

1 Answers1

-1

Preface

In the manual: svn help update+svn help cat+svn help diff can be your best friends. Read commands descriptions, meaning of -r option, format of TARGET-URL or PATH

Face

If you want to switch between two versions of file and do not use in parallel, you can use single WorkingCopy and change only version of needed file in it.

HowTo:

  • Commit-commit-commit. Remember revisions of first and second needed version of file.cpp (let they be N and M, last revision of repo we will name HEAD. N < M < HEAD)
  • Inside working copy (fully updated to HEAD) - return to revision N for single file file.cpp: svn up -r N file.cpp, switch to M: svn up -r M file.cpp, get most recent, HEAD: svn up file.cpp
  • If you want only to see at different versions of file, not use, you can cat any revision of file (not related to revision in WC) or diff between two revisions of single file (may leave WC untouched by these commands)

Sample:

from my WC, short up example

>svn up -r 1687 dcmode.htm
Updating 'dcmode.htm':
U    dcmode.htm
Updated to revision 1687.

>svn up dcmode.htm
Updating 'dcmode.htm':
U    dcmode.htm
Updated to revision 8734.
Brian Webster
  • 30,033
  • 48
  • 152
  • 225
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110