4

I have a file that contains the revision placeholder in the form:

$Rev: 123456 $

The file is checked-in only if it changes, so, if I want to commit it just to update the revision number, I am forced to add a fake change (example: adding a space, a new line, something like that) in order to been able to see it in the change-list and commit it, obtaining the result I am looking for. Even if I modify the revision flag, writing for example:

$Rev: 0 $

SVN is "smart" enough to ignore this change...

Is there a (clean) way to simply tell SVN (tortoise) that the file must be checked in without using these "tricks"?

NOTE: This is needed because the revision number in used in the build. This allows us to clearly identify the version of the build when it is run.

Riccardo Tramma
  • 583
  • 3
  • 8
  • [duplicate](http://stackoverflow.com/questions/206183/how-can-i-force-subversion-to-commit-an-unchanged-file) – shx2 Mar 15 '13 at 10:49

2 Answers2

0
  1. As suggested in linked topic, you can always change some property of file before commit. But if you want to play with content, part of answer from TortoiseSVN FAQ will be useful for you (starting from "Subversion determines whether a file has changed with the following approach...")
  2. From other side, I'll seriously suggest you to re-think about current workflow and use The Right Things for The Right Job - don't rely on keyword of file (file-revision) in order to obtain global repository-wide revison

For "getting repository revision" task you have at least 3 different tools, 2 from which are part of any Subversion, 1 is part of TortoiseSVN:

  • Svnversion. svnversion <Path-to-WC> output global revision number of linked to WC repository, clean numbers without decorations, ready for inclusion into anything

>svnversion

37

(inside WC I skipped path, "." assumed). Output must be translated into smth. like "Latest revision in repo is 37, Working Copy is clean /no uncommited changes, no spare-dirs, state of WC can be reproduced lately/"

>svnversion

37M

Same Working Copy, but changes was performed and still not committed

  • Info. svn info <TARGET> output more verbose information about target, but can be used with repository URL also, not only Working Copy

>svn info

...

Revision: 37

...

Last Changed Date: 2013-01-09 11:45:39 +0600 (Ср, 09 янв 2013)

Only Revision field (and, probably, Last Changed Date) values have interest in this case, but this data must be extracted from output

  • SubWCRev and sample of usage for TortoiseSVN code inside FAQ-topic
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

another approach would be to, simple add a placeholder(empty text file)in the same location and commit this new file along with unchanged file. Later the text file can be deleted.