tags:

views:

328

answers:

3

Hi All, Please let me know which commands should be used for updating the repository non recursively and over writing the changed files using command line

Over writing means if some changes are there to local AssemmblyInfo.vb/cs files in the build machine.It should not update that to the repository while doing svn update

Thanks in advance

A: 

You can checkout svn revert for eliminating checkout changes:

revert: Restore pristine working copy file (undo most local edits).
usage: revert PATH...

  Note:  this subcommand does not require network access, and resolves
  any conflicted states.  However, it does not restore removed directories.

Valid options:
  --targets ARG            : pass contents of file ARG as additional args
  -R [--recursive]         : descend recursively, same as --depth=infinity
  --depth ARG              : limit operation by depth ARG ('empty', 'files',
                            'immediates', or 'infinity')
  -q [--quiet]             : print nothing, or only summary information
  --changelist ARG         : operate only on members of changelist ARG
                             [aliases: --cl]
notnoop
+1  A: 

The following command will run SVN update non-recursively:

svn update --depth=files

In general, you can learn all the options for a given command using:

svn help command

In the above, replace command with the actual command (e.g. "update").

The update command will not modify or overwrite any files with local modifications. If there is a file with local modifications, and you would like to discard these local modifications in favor of the updated version, you can run the command "svn revert" to revert the local modifications and to mark the file as clean.

EDIT: In my initial post, I used "svn update --non-recursive"; however, as has been pointed out, this option is currently listed as obsolete.

Michael Aaron Safyan
Notice that --non-recursive is obsolete, in favor of --depth.
Martin v. Löwis
Yes. You are right. I will modify accordingly.
Michael Aaron Safyan
svn update --depth=files is fine. thank you for this. But if some changes has happened locally . In the sense in previous build if some changes are there to local AssemmblyInfo.vb/cs files in the build machine.It should not update that to the repository while doing svn update.I can do this using revert also.But it will be like 2 commands. Is there any possibilty to do the both using one command
Michael Aaron Safyan
Also, "svn help", without specifying a command, will give you the full list of commands.
Michael Aaron Safyan
+2  A: 

Use svn update with option --depth.

See http://svnbook.red-bean.com/en/1.5/svn.ref.svn.html#svn.ref.svn.sw

Edit:

Over writing means if some changes are there to local AssemmblyInfo.vb/cs files in the build machine.It should not update that to the repository while doing svn update

That is no problem. svn update will never send changed files back to the repository (that's what commit does), it will only fetch new data from the server.

Note: Your question indicates a fundamental misunderstanding about how Subversion (or any version control system) work. Might I suggest reading some Subversion tutorial (or the excellent Version Control with Subversion), that will save you a lot of headache.

sleske