svn diff --diff-cmd diff -x -uw -r 4050:4054 database/vo-common-dml.sqlThe results can be visually improved by two ways:
sudo apt-get install colordiff svn diff --diff-cmd diff -x -uw -r 4050:4054 database/vo-common-dml.sql | colordiff
svn diff --diff-cmd svndiffMELD -x -uw -r 4050:4054 database/vo-common-dml.sql
svn revert deletedDirectory-or-filesource
svn rm
ed two directories. I.e. instead of doing the following:
svn mv dir-a dir-b && svn commit -m "foo"… which was my intention, I mistyped and executed the dreaded:
svn rm dir-a dir-b && svn commit -m "foo"The following command (executed at the root of my entire repository) save the day:
svn merge -r COMMITTED:PREV .(followed by a
svn commit
).
svn update -r 666 file
svn cat -r 666 file | less
svn diff -r 2250 [filename] --diff-cmd meld
svn blame [filename]
svn update
:
$ svn update Updating '.': Skipped 'ivoa-console-utils/sval' -- An obstructing working copy was found At revision 3257. Summary of conflicts: Skipped paths: 1Sometimes just doing an
svn cleanup
seems to work.
mv
the .svn directory out of the way to some other location in the filesystem (outside of the SVN tree)svn update
and svn status
(you should see a bunch of files marked with `D`)mv
the .svn directory back in placesvn update
is now (mysteriously) clean.svn co
the problematic directory somewhere outside the
SVN tree and then move it in place (after rm
-ing the previous directory that existed in its place), again
in conjunction with svn cleanup
.
svn revert
too.
Yeah, it's a bit ugly and non-deterministic I am afraid.
svn status
(following a svn update
):
$ svn status D C sval > local unversioned, incoming add upon update... probably indicates a tree conflict. What has worked for me (assuming the above directory name) is:
$ svn resolve --accept working sval Resolved conflicted state of 'sval $ svn revert sval Reverted 'sval' $ svn status $(following the advices found here and here).
svn co
of the problematic directory in some other locationmv
-ing the just checked-out directory to where it is supposed to besvn log --verbose
.
svn up -r 144 fooIt seems to correctly restore directories too (all files in said directory are restored to the state they had as of that revision).
svn add *This will also add the ignored files, because the command line expands * and therefore svn add believes that you want all files to be added. Therefore use this instead:
svn add --force .
svn revert --recursive folder_nameor
svn rm --keep-local folder_nameso
svn propset --recursive svn:ignore --file /path/to/a/file/with/svn-ignore-rules .
svn pg svn:ignore .or (but that shows all properties, not just svn:ignore):
svn proplist -v .
svn rm --keep-local dirname(why one would want to do that is unclear)
svn add --force * --auto-props --parents --depth infinity -q- so, NB: doesn't seem to add dot files, subsumed in my svn-add-all.sh script (in ~/tools)
svn propedit svn:ignore .
svn status | grep '^?' | awk '{print $2}' | xargs rm -rf
svn blame ./path/to/file.java | sort -n
svn revert -R .
svn diff -r 4703 ./relative/path/to/filename.cpp
svn log -v | head -30
svn merge -c1501 filenameNote that the semantics of the above command are: 'merge the changes found in the specific revision of the file relative to the immediately previous revision (in this case, 1500). To merge a whole contiguous range of revisions you do a:
svn merge -c1000:1501 filename
svn add --depth=empty foodir- or -
svn add -N [directory]
svn propedit svn:ignore .
svn add --depth=empty <directory>
svn revert <directory>and sometimes the following is required:
svn revert <directory> --depth infinity
svn co https://172.31.128.119/svn/neuro-jsf-pilot/trunk/apps/cashflow
svn ls foo.sh
svn propget svn:ignore .
svn mv svn mkdir
Say you wish to go back from commit 75 to commit 68. There are two ways:
svn merge -r 75:68followed by a new SVN commit to push the reverted r68 to the tip.
With the manual way, you create a new folder just to checkout the previous version you wish to revert to (say r68) and do some file-hacking there. Let's call that folder "r68checkoutFolder". This is the source folder for most of the below operations. The target folder is the "checkout75" (latest commit SVN tip) folder. So, in the r68checkoutFolder you do a:
svn checkout -r 68 https://192.168.0.8/svn/neuro-jsf-pilot/trunkThen you remove all metadata svn files using:
find . -iname .svn | xargs rm -rfNow you want to remove from the target (latest release folder) all files that were added since r68. So you do a:
cd /path/to/checkout68 ; find . -type f -exec rm /path/to/checkout75/'{}' \;Then you remove all files in r68 that are identical in r75. To do that we use the ttsiodras utility cmpDir1andDir2andRemoveSamesFromDir1:
cmpDir1andDir2andRemoveSamesFromDir1 r68checkoutFolder /path/to/checkout75And then remove all empty folders using:
find . -type d -depth | xargs rmdirAt this point, what's left in the r68checkoutFolder is the files that were modified between revisions 68 and 75. And we are also guaranteed that any new files in r75 have been deleted. So all that's left is move the remaining files over to r75:
find . -type f -exec mv '{}' /path/to/checkout75/'{}' ';'At the end of the move it should be the case that the source folder is empty. If this is so, we can then follow and close the manual process with a commit at the target folder:
svn commit -m "manually reverted back to r68"
checkout, update, status, info, log, commit, add, rm
svn revert 'filename' '.' 'foldername'
svn commit -m "message" 'filename' (or no 'filename' for all modified files