I SVN updated, but I realize I messed up - linux

How do I rollback to a previous revision? So that my files are back to revision 400?

How about:
svn merge -r [current_version]:[previous_version] [repository_url]
svn commit -m “Reverting previous commit and going back to revision [previous_version].”
taken from http://mybravenewworld.wordpress.com/2007/11/13/subversion-how-to-revert-a-bad-commit/

svn update -r 400

Run the following command:
svn -r rev-no up file-name

Related

svn undelete and change status on folders and files

i want to undelete these files
[root#localhost sn_dev]# svn log -v --xml | grep 'action="[D]"'
action="D"
action="D">/branches/sn_dev/mob/assets</path>
action="D">/branches/sn_dev/mob/javascripts</path>
action="D">/branches/sn_dev/mob/json</path>
action="D"
i have done
svn revert --recursive mob
svn commit -m "readded files"
however the files still shows deleted status on SVN...
any help?
The svn revert command only undoes local edits (i.e. changes that have not yet been committed). Since you show the files were already committed, you cannot use that command.
You'll need to merge the reverse of the revision in which they were committed. If, for example, the files were deleted in revision 89, you'd do the following:
svn merge -c -89 .
The -c option is shorthand, in this case, for -r 88:89, and the dash before the 89 will reverse the range to give you -r 89:88. This command means, "merge the changes it would take to get revision 89 to revision 88, into my working copy." The period at the end is the working copy, and should be the directory those files will be restored to.

How to ignore .*o*.cmd on a local linux repository?

I would like to ignore all files like .sddr09.o.cmd or .karma.o.cmd etc onto a kernel svn repository.
I try somme commands like :
svn propset svn:ignore '*.cmd' . --recursive
or
svn propset svn:ignore '*.o.cmd' . --recursive
or
svn propset svn:ignore '.*.o.cmd' . --recursive
but no one success to prevent from commit these files.
So I try to use the dontdiff file located in linux/Documentation/dontdiff appending
*.cmd
*.o.cmd
.*.o.cmd
at the end of the file
and I use the following command line :
svn propset svn:ignore -R -F Documentation/dontdiff .
but no more success.
Any Idea ?
You mention in the comments that you've already added these files, so the first step is to undo that. Presumably you used svn add to add the files, so you'll need to use the inverse of that: svn delete.
svn delete --keep-local path/to/file
The --keep-local will tell SVN not to undo any modifications you've made. If you do want to reset the files to their original state (or delete them if they didn't exist before), you can omit the option.
You can confirm this with svn status. The files in question should not have anything in the first column.
After that, you should be able to run the svn ignore commands that you included in your question.

Calling svn diff on some revision and previous revision, with no local copy

I have no local copies of any files from the SVN repository. I do have a full path URL to some file in SVN. How can I see the difference between revision 1234 of that file, and it's previous revision, whatever it may be?
svn diff -c 1234 $URL
Assuming you are using a version of Subversion newer than 1.4 when -c was added. Otherwise you need to do:
svn diff -r 1233:1234 $URL
If you want to see a diff including changes across multiple revisions you can just expand the revision numbers you provide to -r.
You can see detailed documentation of the diff subcommand in the SVN Book.

SVN - Commit via VIM - Recover failed commit message

I typically use VIM for almost everything coding-related.
I have configured my environment so Subversion opens VIM to edit the commit message when I execute svn commit. If I close VIM without saving the commit message (eg: :qa!), it is discarded, and the commit operation is aborted.
If I save and close VIM, then the commit operation will commence.
If the commit fails, I have some SVN commit messages that appear to be saved in /tmp/ with file names like svn-**.tmp.
While writing the commit message in VIM, the commit message appears to have a file name of svn-commit.1.tmp. I would like to be able to recover this message for my next SVN commit. The typically use case is:
I attempt to commit; complete writing message in VIM
Commit fails
I resolve the issue (eg: svn update)
Now I want to attempt svn commit again with the previous message pre-loaded into VIM
Thank you for your help.
You could always use the -F option with svn commit, which uses a file to create the log message.
Whenever I commit with svn, I first create a log file:
vim log_file
Then I use the following to commit:
svn commit -F log_file --username blah
This has always worked great for me.
You could try something like this:
svn commit -F /tmp/svn-1.tmp
You can read more there: http://svnbook.red-bean.com/en/1.0/re06.html
When in your vim session, just read the contents of the old log file. This permits you to adapt the old message if necessary, and doesn't change the workflow radically.
svn commit
(opens vim session)
:r /tmp/svn-**.tmp
Another solution is to just do your commits from the command line with the -m flag. This typically has the last (failed) commit in the command history of the related shell.
svn commit -m "Here is my message"
(commit fails, and you resolve it)
(up arrow a few times, and rerun the commit)
Git will store a cached version of your commit message in .git/COMMIT_EDITMSG.
After a "failed" committing attempt, you could run the following to recover your commit message.
vim .git/COMMIT_EDITMSG

How do I revert back to a previous SVN commit?

Suppose I'm at revision 50.
But, I want to revert back to revision 45, and commit back as the stable version.
How do I do that, in the most simple way?
What if I want to do that with one file?
What if I want to do that with the entire repository?
I'm not sure what you mean by "commit back as the stable version", but depending on what you're trying to accomplish I recommend:
svn update -r45
This will rebase your working copy at revision 45.
or:
svn merge -c -50,-49,-48,-47,-46
This will update (by reverse-merging) your working copy by removing all the changes between 45 and 50. Now if you make changes and commit, it will be like you have removed 46-50 from the repository and made the HEAD revision (51?) to be r45 + your change.
Reverse merge those revisions that you want to undo. This can be done on one or multiple files. By reverse merging, your working copy gets changed to the state without that revision, which you then can commit.
You can simply do an update to revision using
svn up -r 45
But this will not let you commit the changes as SVN needs you to update your working copy to HEAD before you can commit. What you can do instead is
svn merge -r HEAD:45 yourFile
svn ci yourFile -m "Reverting back to rev 45"
I think one simple way should be this:
checkout revision 45 to a temporary directory
copy one or alle files to your working directory
commit

Resources