Showing posts with label SVN. Show all posts
Showing posts with label SVN. Show all posts

Wednesday, December 23, 2015

Move SVN repository from one server to anther

http://www.petefreitag.com/item/665.cfm

Step 1: Backup your old Repository
The first thing you need when moving from one server to another is a dump of your subversion repository. Hopefully you are already creating dump's with a backup script, but if not here's how you can create a subversion dump file:

svnadmin dump /path/to/repository > repo_name.svn_dump

The dump file contains all the revisions you have ever made to your svn repository, so it will probably be quite large (it even includes files you may have deleted in a previous revision).

Step 2: Create the new Repository Now, simply transfer the dump file on to your new subversion server, and create an empty repository:

svnadmin create /path/to/repository

Step 3: Import your old repository into the new one Next import your dump file:

svnadmin load /path/to/repository < repo_name.svn_dump

You may want to force subversion to use the same UUID for the new repository as the old repository. To do this add --force-uuid to your svnadmin load command. In my case I wanted to do this. If you have already loaded your repository, there is a way to set the UUID at a later date, check the docs. That's it, you now have a replica of your old repository on your new server.


HOW TO RELOCATE YOUR LOCAL COPY:
$ svn switch --relocate svn+ssh://username1@server1/home/username1/repos/file svn+ssh://username2@server2/home/username2/repos/file

Wednesday, May 7, 2014

SVN ignore

$ svn propedit svn:ignore .
edit that file like following:
  1 *.out
  2 sftp
  3 sftp-server
  4 ssh
  5 ssh-add
  6 ssh-agent
  7 ssh-keygen
  8 ssh-keyscan
  9 ssh-keysign
 10 ssh-pkcs11-helper
 11 sshd

 12 scp

http://stackoverflow.com/questions/122313/how-do-you-include-exclude-a-certain-type-of-files-under-subversion

Tuesday, February 4, 2014

Install svnnotify on CentOS 6

http://pkgs.org/centos-6/repoforge-i386/perl-SVN-Notify-2.80-1.el6.rf.noarch.rpm.html


Install Howto

  1. Download the latest rpmforge-release rpm from
    http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/
  2. Install rpmforge-release rpm:
    # rpm -Uvh rpmforge-release*rpm
  3. Install perl-SVN-Notify rpm package:
    # yum install perl-SVN-Notify
  4. You may have some error message 
Warning: post-commit hook failed (exit code 2) with output:
Use of qw(...) as parentheses is deprecated at /usr/share/perl5/vendor_perl/SVN/Notify.pm line 730.
Can't locate HTML/Entities.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/share/perl5/vendor_perl/SVN/Notify/HTML/ColorDiff.pm line 6.

                Fix it: # yum install perl-HTML-Parser

Monday, October 28, 2013

svn change username

 http://stackoverflow.com/questions/7671662/svn-change-username

Wednesday, January 9, 2013

Show all the SVN logs

$ svn log

Saturday, November 3, 2012

Remove file from subversion after svn add but before svn commit

svn revert filename

http://picobit.wordpress.com/2009/05/06/remove-file-from-subversion-after-svn-add-but-before-svn-commit/

Thursday, July 5, 2012

set SVN repository II

Login into your server
mkdir svnrepos
cd svnrepos
mkdir ProjectName
svnadmin create ProjectName

Login into your local working machine
svn co svn+ssh://username@servername/home/username/svnrepos/ProjectName ProjectName

cd ProjectName and do whatever you want


Tuesday, March 13, 2012

Create mailing list


-bash-4.1$ sudo vim /etc/aliases  

-bash-4.1$ sudo postalias /etc/aliases



More: http://linuxgazette.net/issue72/teo.html

Thursday, December 1, 2011

latexdiff for Paper in PDF

1. Install the latexdiff
http://fengweizhang.blogspot.com/2010/12/subversion-latex.html

2. run: 
$ latexdiff -t CFONT --flatten ../HC-4/main.tex main.tex > doc.tex

-t CFONT: type of latexdiff
--flatten: reversal of directory
../HC-4/main.tex: old version of main.tex of paper
main.tex: new version
doc.tex: output file

3. run: 
$ pdflatex doc.tex 
if reference cannot show, change the makefile from main to doc

compile the tex file and generate the pdf file

Other option(doesn't work on my Mac):
$ latexdiff-vc -t CFONT --fatten --svn -r 7 main.tex --pdf
latexdiff-vc: combine latexdiff and version control
-t CFONT: type
--fatten: reversal of directory
--svn: version control type
-r 7: compare to old version 7
main.tex: current version
--pdf: run pdflatex to generate pdf

more info:
http://helpful.knobs-dials.com/index.php/Latexdiff
http://web.njit.edu/all_topics/Prog_Lang_Docs/pdf/latexdiff/latexdiff-man.pdf

Monday, October 31, 2011

Setup SVN email notification

http://help.joyent.com/index.php?pg=kb.page&id=53

step1:
copy the post-commit.tmpl to file post-commit

step2:
edit post-commit file

comment out
# "$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf

add
/usr/local/bin/svnnotify -r $REV -C -d -H HTML::ColorDiff -p $REPOS -t emailList --from emailList --reply-to emailList

step3:
chomod a+x post-commit

Monday, October 24, 2011

How to create a SVN repository

This is from my Advanced programming class notes:


Subversion (svn) is a source code version management system.  Such a
system is most useful when you work in a team, but even when you’re
working alone, it’s a very useful tool to keep track of the changes
you have made to your code.
In this class, the use of a version control system is required.  If
you are already familiar with another system such as Perforce or
BitKeeper, you can talk to me about using them instead of svn.  (But
not cvs.  I want cvs users to switch to svn in this class.) You’ll
learn the basics of svn in this part of the lab assignment.
(a) Creating the Subversion source repository
The first thing you need to do is to create a repository under your
home directory so that svn can store revision histroy of your files.
    $ cd ˜
    $ mkdir svnrepos
    $ chmod 700 svnrepos
    $ svnadmin create ˜/svnrepos
(b) Adding a directory to the repository
This process creates a subdirectory in your svn repository.  We create
a subdirectory called "cs3157" which will house all our code in this
class.
    $ cd ˜
    $ svn mkdir file://$HOME/svnrepos/cs3157
svn will start your editor to ask you to say something about what
you’re doing.  Type "create cs3157 subdirectory" on the 1st line, save
and quit the editor.  You do this everytime you "commit" a change to
the svn repository.
You can list the content of your repository using:
    $ svn list file://$HOME/svnrepos
(c) Checking out cs3157 directory into a local working directory
Note that we created the cs3157 "subdirectory" in the repository, not
in your home directory.  In fact, cs3157 is a subdirectory in the
repository in a logical sense; if you look in ˜/svnrepos, you won’t
find any directory named cs3157.
Now we will create a physical "working copy" of the cs3157
subdirectory by "checking it out".
    $ cd ˜
    $ svn checkout file://$HOME/svnrepos/cs3157Now you can see there is a physical directory cs3157 under your home
directory.  Go into it and see what’s in there.
    $ cd ˜/cs3157
    $ ls -alp
Note that the directory contains a subdirectory called ".svn".
Subversion uses that directory to manage your working directory.  This
directory should be included in your submissions so that we can verify
that you’re using svn correctly.
(d) Creating and adding a directory for this lab session
    $ cd ˜/cs3157
    $ mkdir lab1
    $ svn add lab1
Or in one step,
    $ cd ˜/cs3157
    $ svn mkdir lab1
Your action of adding the lab1 directory to the svn repository is now
pending.  Type "svn status" to see what’s pending.
You "commit" your changes by:
    $ svn commit

(e) Adding files
Let’s add part2 directory first:
    $ cd ˜/cs3157/lab1
    $ svn mkdir part2
    $ cd part2
Now you are ready to write code!  Using your editor, write hello.c and
add it to the respository.
    $ vim hello.c
 
        #include <stdio.h>
        int main() {
            puts("hello world!");
            return 0;
        }
    $ svn add hello.c
Try compiling and running:
    $ gcc -g -Wall -o hello hello.c
    $ ./hello
Finally, commit the change you’ve made.    $ svn commit
(f) Other svn commands
To see the status of your files in the current directory in relation
to the repository:
    $ svn status
To see the difference between your working files and the latest
committed versions in the repository:
    $ svn diff
To print out log information:
    $ svn log hello.c
If you want to abandon the changes you made to your working copy, and
revert the file into the version last commited to svn (losing all your
changes!!!):
    $ svn revert hello.c
You can delete a file with "svn rm" command.  Type:
    $ svn rm hello.c
If you do "ls", you’ll see that your local copy of hello.c is gone.
However, the deletion is still pending, since you did not commit your
action yet.  You can get back your hello.c by typing:
    $ svn revert hello.c
You can see a manual page of any svn command using "svn help".  Try:
    $ svn help
    $ svn help status
Lastly, "svn update" command is normally used for collaboration.  For
example if you were working in a team working on a same set of code,
you would typically issue "svn update" in the beginning of your day to
bring in your teammates’ commited changes.

Friday, April 1, 2011

SVN tips

1. find current version of the project: svn info


2. $ svn checkout --username fengwei --password hello123 URL


3.  check out to a new name 
$ svn co svn+ssh://username@servername.com/home/username/svnrepos/file newfilename
find

4. man page of svn co: svn check -h

5.  $ svn diff --help

6. 
cd into a working directory (doesn't need to be latest version)
$ svn diff -r 4 > diff.txt
this will generate the difference between current version 10 and version 4

Tuesday, December 7, 2010

subversion + Latex

subversion repository setup:
Howto: http://fengweizhang.blogspot.com/2011/10/how-to-create-svn-repository.html

remember, you need to set up the ACL permission correctly for your svn repository. so other people could checkout, commit

$svn co svn+ssh://username@servername.com/home/username/svnrepos/file

The idea is setup a projectfile in svn repositary. so memeber could check out the files and write the papers. Then he could commit it.


Latex How-To
Ubuntu: install texlive
$sudo apt-get installl texlive. 

you could use whatever editor you want: Vim
Then find two things:
a tutorail for latex grammer: lshort.pdf
a latex template:

Mac: install latex
sudo port install texlive
OR
install MacTex
http://guides.macrumors.com/Installing_LaTeX_on_a_Mac
or directly download from:
http://www.tug.org/mactex/2011/
But this file is very large.

Updated March 30 2014: 
Install Latex on Mac
1. Go to http://guides.macrumors.com/Installing_LaTeX_on_a_Mac
2. Download MacTeX at http://www.tug.org/mactex/
3. Be Patient, and it is a large file
4. Install it. If you have previous version installed, you can uninstall them by delete /usr/local/texlive
See http://tug.org/mactex/uninstalling.html


CentOS: install tetex
yum install tetex tetex-fonts tetex-dvips tetex-latex ghostscript


EDITOR: You could use VIM, texmaker is good.