CVS

set access

  • set access to CERN cvs by SSH
    • export CVSROOT = :ext:cvstopan@isscvs.cern.ch:/local/reps/top_analysis
    • export CVS_RSH=ssh
  • my cvs account is: cvstopan
  • login cvstopan on lxplus.cern.ch and organize the reponsitory in /afs/cern.ch/project/cvs/reps/top_analysis

creat project mannual

  • see created projects at cvs project AnalysisExamples
  • create projects: (stand in the directory of AnalysisExamples)
    • cvs import -m "release 10.0.1 start point" AnalysisExamples athena10_0_1 AnalysisExamples10_0_1-0_0
    • cvs import -m "release 11.0.41 start point" AnalysisExamples athena11_0_41 AnalysisExamples11_0_41-0_0
    • cvs import -m "release 12.0.6 start point" AnalysisExamples athena12_0_6 AnalysisExamples12_0_6-0_0
  • this can be used to create project under some project
    • cvs import -m "test" AnalysisExamples/test test test1
    • cvs checkout -r test1  AnalysisExamples/test
  • just make a container directory
    • cvs import -m "project container" myAnalysisCode R0 R00
  • create projects with some files ignored
    • cvs import -I*ps -I*.gif  -m "1206vs1303" myAnalysisCode/1206.vs.1303 R0 R0_0

to Check out

  • file
  • module
    • cvs co -r AnalysisExamples11_0_41-0_0 AnalysisExamples *
    • cvs co -d mynew -r AnalysisExamples11_0_41-0_0 AnalysisExamples
    • -q quiet on output
    • -d creat and use this directory to contain this checkout release, here you will see a package named as "mynew" ,not "!AnalysisExamples", but the content is same as last command
    • Similarly, cvs co -d mynew1 -r R0_0 myAnalysisCode/Abias will not use long directory myAnalysisCode/Abias. but only put all content to "mynew1"
  • add remove file
    • cvs add file
    • cvs remove file
    • cvs commit=

SVN

set access right for other person

  • change file /afs/cern.ch/project/svn/reps/topana/conf/authz

documents

use in CERN or outside of CERN

  • the example in the following is for using svn in CERN with lxplus.cern.ch
  • if use it outside of CERN change "svn+ssh://svn.cern.ch" to "svn+ssh://Accountname@svn.cern.ch" in all the example below.
    • for example, Duyanyan has account on lxplus.cern.ch "ydu" the she use svn+ssh://ydu@svn.cern.ch to access SVN

the repository

  • the main reponsitory is svn+ssh://svn.cern.ch/reps/topana, you can view it with web https://svnweb.cern.ch/cern/wsvn/topana/
  • directory in the repository are opened for persons, they have the write and reading right.
    • svn+ssh://svn.cern.ch/reps/topana/ydu for duyanyan
    • svn+ssh://svn.cern.ch/reps/topana/rshao for shaoruobin
  • to do excise, for example, ydu
    • svn mkdir svn+ssh://ydu@svn.cern.ch/reps/topana/ydu/test to make a subdirectory and do any excise in it
    • to make a directory structure for your package saving is a good cumtom.

import

  • first time to check in one package, e.g. import package MyD3PD_Ana/ to name topD3PD in responsitory
    • svn mkdir svn+ssh://svn.cern.ch/reps/topana/topD3PD
    • svn mkdir svn+ssh://svn.cern.ch/reps/topana/topD3PD/trunk
    • svn import --message "Initial import" MyD3PD_Ana/ svn+ssh://svn.cern.ch/reps/topana/topD3PD/trunk
      • all the files and subdirectories in MyD3PD_Ana will be copied in to trunk as a developing code

check out

  • svn co svn+ssh://svn.cern.ch/reps/topana/topD3PD/trunk test
    • will checkout all file and directories in "topD3PD/trunk" directory to a dir "test"

commit

  • svn commit --message " "
    • this will only write back the changes of existing files, not add new files in working copy to reponsitory.
  • if want to add new files, use: "svn add file" and then "svn commit"

make tags

  • when code in truck has been developed for some time and is good to use, you can make a copy in the tags directory
  • svn copy --message " say something for this version" svn+ssh://svn.cern.ch/reps/topana/topD3PD/trunk svn+ssh://svn.cern.ch/reps/topana/topD3PD/tags/version_1_0
  • this is samilar that you are providing a good product to people, so you give a clear tag name.

merge

  • This is an example of how to cooperate in code developing with "svn merge"

  • Downloading JetSelectionD3PD-00-00-06 to your working copy JetSelectionD3PD
  • if user wants to modify this package:
    • cd JetSelectionD3PD
    • svn import -m"start of JetSelectionD3PD-00-00-06 branch JetSelectionD3PD-01" svn+ssh://svn.cern.ch/reps/atlasmon/JetSelectionD3PD/branches/JetSelectionD3PD-01 //e.g it is rev 100
    • svn switch svn+ssh://svn.cern.ch/reps/atlasmon/JetSelectionD3PD/branches/JetSelectionD3PD-01
    • svn ci -m"...."
  • I will merge your modification into my JetSelectionD3PD/trunk
    • cd JetSelectionD3PD // this is my developing copy which may also changed a lot
    • svn merge svn+ssh://svn.cern.ch/reps/atlasmon/JetSelectionD3PD/branches/JetSelectionD3PD-01@100 svn+ssh://svn.cern.ch/reps/atlasmon/JetSelectionD3PD/branches/JetSelectionD3PD-01
    • If no conflicts ( both didn't modify the same line, it's OK, otherwise you can choose option (p), and edit after merging.
    • svn ci -m"dev"
    • make new tag
  • be careful, for each new downloaded tagged package, you should make a new branch, the old branch will be discarded.

problem

svn: Checksum mismatch for file ...

solution:
  • backup file
  • svn delete --force file
  • cp file back
  • svn add file

error in commit:

  • error message
svn: Commit failed (details follow):
svn: Directory '/tmp/czhu/forR16Data_4/externalPac/RootCore/python/.svn' containing working copy admin area is missing

  • solution
    • mv it out and svn delete the directory
    • mv it back and svn add

  • 2
svn: Commit failed (details follow):
svn: No repository found in 'svn+ssh://svn.cern.ch/reps'

  • solution no very good solution now svn diff to find which files need to be committed svn ci XXXXfile -m"" to check in the files one by one. remove this working copy and re-checkout all the copy.

*3

svn: Directory 'externalPac/RootCore/python/.svn' containing working copy admin area is missing

  • solution rm externalPac/RootCore/python svn del --force externalPac/RootCore/python

but this will induce the problem 2 above.

  • 4
Transmitting file data .svn: Commit failed (details follow):
svn: Commit blocked by pre-commit hook (exit code 1) with output:
Some parts of your commit look suspiciously like merge
conflict markers.  Please double-check your diff and try
committing again.

  • solution some contents of the files are rejected by svn. you can commit files one by one to see which file does match the problem

*5 svn: Commit blocked by pre-commit hook (exit code 1) with output: Clash: '/xAODanalysis/trunk/MyPhysics/MyPhysics/physicsD3PD.h' '/xAODanalysis/trunk/MyPhysics/MyPhysics/PhysicsD3PD.h'

  • solution, there are two files in the same directory, which are only different in Capton letters.

*6 svn: Directory '/DMcode/trunk/configure/backupCode' is out of date

move your useful files to other place, run "svn up configure/backupCode", move your useful files back and do svn add or ci.

*7 svn ci -m"update" svn: Commit failed (details follow): svn: Aborting commit: '/afs/cern.ch/user/c/czhu/xAODanalysis/MyAnalysis' remains in conflict

svn resolve MyAnalysis --accept working //according to which version you want to keep.

Edit | Attach | Watch | Print version | History: r26 < r25 < r24 < r23 < r22 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r26 - 2015-01-05 - ChengguangZhu
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback