Yinghui Wang

Similar documents
Subversion Repository Layout

Subversion. Network Monitoring & Management

Version Control. Kyungbaek Kim. Chonnam National University School of Electronics and Computer Engineering. Original slides from James Brucker

Subversion. An open source version control system. W. Miah escience Rutherford Appleton Laboratory

Common Configuration Management Tasks: How to Do Them with Subversion

Subversion. CS 490MT/5555, Fall 2015, Yongjie Zheng

An Introduction to Subversion

Department of Computer Science College of Engineering Boise State University

2/9/2013 LAB OUTLINE INTRODUCTION TO VCS WHY VERSION CONTROL SYSTEM(VCS)? II SENG 371 SOFTWARE EVOLUTION VERSION CONTROL SYSTEMS

CSCI 4152/6509 Natural Language Processing. Lab 1: FCS Computing Environment

CS2720 Practical Software Development

[Software Development] Development Tools. Davide Balzarotti. Eurecom Sophia Antipolis, France

TDDC88 Lab 4 Software Configuration Management

Source Control. Comp-206 : Introduction to Software Systems Lecture 21. Alexandre Denault Computer Science McGill University Fall 2006

CS480. Compilers Eclipse, SVN, Makefile examples

CSC 2700: Scientific Computing

Exercise 3: Adding a file to the master directory

Subversion FOUR. 4.1 What is Version Control? 4.2 What is Subversion? Types of Version Control SESSION

Software Development I

Manage quality processes with Bugzilla

Source control with Subversion A user perspective

MNXB Working with SVN. Florido Paganelli Lund University Tutorial 2b

Revision Control and GIT

CSE 390 Lecture 9. Version control and Subversion (svn)

Revision Control. Software Engineering SS 2007

Revision Control II. - svn

Chapter 3. Revision Control

9 and 11-Jan CSCI 4152/6509 Natural Language Processing Lab 1: FCS Computing Environment, SVN Tutorial. FCS Computing Environment, SVN Tutorial

VSO. Configuration Management

Software Tools Subversion

1 ope. TortoiseSVN 1.7. Beginner's Guide. Perform version control in the easiest way with the. Lesley Harrison. best SVN client-tortoisesvn

Revision control systems (RCS) and. Subversion

Introduction to Revision Control

Apache Subversion Tutorial

Source Code Management

Version Control Systems

Git & Github Fundamental by Rajesh Kumar.

CVS. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 21

Using Subversion with LeMANS and MONACO

Warmup. A programmer s wife tells him, Would you mind going to the store and picking up a loaf of bread? Also, if they have eggs, get a dozen.

CSE 374 Programming Concepts & Tools. Hal Perkins Winter 2012 Lecture 16 Version control and svn

Lab Working with Linux Command Line

SECTION 2: CODE REASONING + PROGRAMMING TOOLS. slides borrowed and adapted from Alex Mariakis and CSE 390a

Version Control. 1 Version Control Systems. Ken Bloom. Linux User Group of Davis March 1, 2005

Managing Source Code With Subversion

Home Page. Title Page. Contents. Page 1 of 17. Version Control. Go Back. Ken Bloom. Full Screen. Linux User Group of Davis March 1, Close.

Part I Part 1 Version Control Systems (VCSs)

Computer Labs: Version Control with Subversion

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

TangeloHub Documentation

Part I Part 1 Version Control Systems (VCSs)

Version Control Systems

Introduction to the UNIX command line

Introduction To Python

Introduction to distributed version control with git

Subversion Branching and Merging. Jan Skalický

Introduction to version control. David Rey DREAM

Part I Part 1 Version Control Systems (VCSs)

Computer Labs: Version Control with Subversion

Importing Files and Directories $ svnadmin create \

Apache Subversion (SVN)

Computational Physics Compiling a C++ program

Apache Subversion (SVN)

Computer Science 62 Lab 8

Project Management. Overview

17008 VCS Subversion Version Control System

February 2 nd Jean Parpaillon

CSCI 2132 Software Development. Lecture 5: File Permissions

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum

Version Control Systems

What is Subversion and what does it do?

Portions adapted from A Visual Guide to Version Control. Introduction to CVS

About CVS. 1 Version Control - what is it? why is it useful?

A Practical Introduction to Version Control Systems

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

CSE 160: Introduction to Parallel Computation

Git Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : October, More documents are freely available at PythonDSP

LAB 0: LINUX COMMAND LINE AND SVN

SVN Tutorial for Windows Users

CS 261 Recitation 1 Compiling C on UNIX

Lecture 01 - Working with Linux Servers and Git

2/8/18. Overview. Project Management. The First Law. What is Project Management? What Are These Changes? Software Configuration Management (SCM)

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Version control. what is version control? setting up Git simple command-line usage Git basics

Git for Subversion users

Version Control Systems (VCS)

Next Generation Software Configuration Management with Subversion

Version Control System. -- base on Subversion 1.4

Workshop: High-performance computing for economists

Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

Managing your code: version control

Using Assembla in PracTEX Production

2 Initialize a git repository on your machine, add a README file, commit and push

Parallel Programming Pre-Assignment. Setting up the Software Environment

Terminal Windows, Emacs, Subversion and Make

Table of Contents: Tortoise SVN is used as a source control for FpML.

Object Oriented Programming. Week 1 Part 2 Git and egit

Transcription:

Yinghui Wang wang382@mcmaster.ca 1

What is subversion Subversion is the tool for controlling the versions of your files. To retrieve a specific version of files To synchronize the modification made by multiple developers to the same files Keep a record of development process 2

Example Suppose you are working on a project alone: Rollback to every copy that you submit to the repository. Suddenly you realized that after weeks of work and after many modifications, the project works not as good as before. Svn can allow you to roll back to a previous version of your project. Suppose you are working on a project as a team member: What if there are conflicts on the same files from different members. Who made THAT change in the file? 3

Where to Get Windows: TortoiseSvn (http://tortoisesvn.tigris.org) - - - integrated with window explorer. Linux or Mac: sudo apt- get install subversion subversion- tools or make and make install the total install package to install. Login into mills, or moore to use it directly. 4

Some terminologies Repository - - - a directory containing the master copy of the project files as well as the changes made to these files. Working directory - - - a directory owned by a developer where she/he edits the project files. Check out - - - retrieve a set of files from repository to working directory. Commit (check in)- - - place the changes made to the files in the working directory into repository. Import - - - add an entire directory tree of files into the repository. The FIRST time when move project files into the empty repository. Update - - - merge the latest changes in the repository into the working copy files. 5

Subversion servers Subversion has two network server options: Apache/WebDAV - - - https:// format. svnserve - - - svn:// format. If you want to create a repository by yourself for your group and make the repository available through network. If you just need to access to your repository locally (by yourself), you do not need a subversion server. 6

Repository URL Schemes http:// or https:// - - - - - when the repository is hosted by a Apache/webDAV server svn://server_name/path/to/repository - - - when the repository is hosted by a svnserve server. file://localhost/path/to/repository - - - when repository and the client are on the same machine or file:///path/to/repository if localhost is omitted. (note: on Windows, if the repository on a different drive, z: for example, the URL would be: file:///z:/path/ to/repository, still use slash rather than back slash) 7

Work Cycle svn import ~/myassignment1/ https://websvn.mcmaster.ca/ cs3c03-4co3/groupn/assign1 - m initial import this example will import files and directories under ~/ myassignment1 into the repository svn co checkout https://websvn.mcmaster.ca/cs3c03-4co3/groupn/ assign1 ~/Groupworkassignment1 This will checkout a copy of latest revision files form the repository and save the working copy in ~/ Groupworkassignment1 svn checkout https://websvn.mcmaster.ca/4co3/groupn/assign1 - r 3 will check out the revision 3 of the files under assign1 directory from the repository and save the working copy to local. This command will create the assign1 directory ~/myassignment1/ can not be used as ~/Groupworkassignment1 svn update up [- r] path, if have checked out for a while. Without path, all local files and directories will be updated to the newest version in repository. svn up r 4 mywork.txt will update mywork.txt in respository back to version 4. Use some option commands provided by svn update when conflict occurs. such as mc or tc 8

svn update (mc) mine- conflict - accept my version for all conflicts (tc) theirs- conflict - accept their version for all conflicts (mf) mine- full - accept my version of entire file (even non- conflicts) (tf) theirs- full - accept their version of entire file 9

Work Cycle svn add delete modify ~/ Groupworkassignment1/1.txt svn delete(del, remove, rm) path m delete mywork svn copy file_name new_file_name (cp) svn move file- name new- file_name svn update svn commit ~/Groupworkassignment1/2.txt m this is my 1.txt You must provide an message even it is empty. Eeeeeehh.. Why my commit fail?? Update it again. You might see conflict. svn resolve - accept= arg 1.txt or svn revert 1.txt Throw away your own changes and start you edit again Modify the conflict to what you think is right. Give remarks. svn resolved 1.txt will remove the conflicted state on the working copy. Commit it again. svn help READ THE DOCUMENT. 10

Import with TortoiseSVN Right click the folder containing the prototype project and then select import. 11

Import with TortoiseSVN Provide the repository URL, and specify a log message 12

Import with TortoiseSVN 13

SVN STATUS http://svnbook.red- bean.com/en/1.0/re26.html? item in not under svn version control, D Delete, A Add! file missing, M Modified, L Locked; C- Conflict with updates received from the repository. 14

15

Create repository svnadmin create repso_dir example: svnadmin create ~/svnrp - - - This example will create a directory svnrp under home directory. svnrp contains a subversion repository and a group of other directories and files which help to manage the subversion repository. (note: the repso_dir has to be local) Change the permission bits so that: The Apache server can read and write to the directory if apache server is used to host the repository. Secure enough (700) if you will run your own svnserve server, or if you want to use the repository locally. Note: you only need to do this step if you want to create your own repository. Most of the time, Derek takes care of this step for you. 16

Other svn commands svn log [ r rev#[:rev#]] - - - to view the log file. examples:svn log svn log r 8 svn log r 3:8 or svn log r 8:3 svn list url or svn ls url - - - to view the files and directory names in the repository. svn cat [- r rev#] filename - - - to view the file contents of a specific version. svn checkout r rev# - - - to check out a specific revision svn cleanup - - - run leftover logs, finished uncompleted jobs and remove locks if the subversion processes were interrupted. 17

Other svn commands svn blame item - - - show revision numbers, authours for each line of contents of a specified files or URLs svn export - - - export a clean directory tree. Files not under version control will not be copied. Example: svn export [-r 3] https://websvn.mcmaster.ca/ robert/trunk ~/temp svn export trunk ~/temp1 svn mkdir - - - make a new directory Example: svn mkdir trunk/newdir svn mkdir https://../trunk/proj/newdir 18

svnserve Server to roll your own repository on network or for a group Start server Start server as a daemon: svnserve d Start server as a daemon and specify a repository path: svnserve d r path/to/repository Note: If r option is used, the svn URL must use the short format. Example: on birkhoff, if run: svnserve d r ~/ mysvnrp and If a project is under ~/mysvnrp/proj then the URL for the project would be: svn://birkhoff/proj Start server to listen to a port other than the default port (3690): svnserve d - - listen- port=7654 then the URL would be svn://birkhoff:7654/.. Edit conf/svnserve.conf, which is under the repository directory 19

Typical svnserve.conf [general] anon-access= none to auth-access=write password-db=passwd realm= Robert s repository # must begin with the first column #unauthorized people. none for no right #read and write. read for viewing the #content, for checking out. write for #deleting, for checking #this is the normal case # specify the file passwd, which is under the #same directory, as the file containing authorized #users names and their passwords. # not essential 20

Sample password- db file for svnserve.conf [users] john=abcd123 mark=234qwe jen=plhgt 21

PracKce - - - - create your own repository for prackce ssh birkhoff - - - - - logon to birkhoff where svnadmin is avalable. Your CAS login name and password are required. cd ~ - - - - - make sure you are under your home directory mkdir svnrepo - - - - - - - - - make a directory under your home directory svnadmin create svnrepo/ - - - create a repository ls la svnrepo/ - - - - will see a lot of system file are there. 22

PracKce- - - create a inikal project mkdir svninit - - - create an directory for initial project cd svninit - - mkdir trunk mkdir branches mkdir tags cd trunk cp /u0/staff/robert/unixtutorial/ver1.txt./ try.txt - - - a lazy way to create your initial project. 23

The content of try.txt the first line--remain the same the second line-- will change it the third line-- will change it the forth line--remain the same the fifth line--will change it the sixth line--will change and add a new line below the seventh line---remain the same the eighth line --will be deleted the ninth line --will be deleted the tenth line--remain the same then add some new lines. 24

PracKce- - - import the inikal project into repository cd ~ - - - - go back to your home directory pwd - - - - - show what is the absolute path of your home directory svn import ~/svninit/ file:///the_pwd_result/ svnrepo/ - m my initial project svn list file:///the_pwd_result/svnrepo/ - - - - check what is in the repository. svn list file:///the_pwd_result/svnrepo/trunk/ - - - check what is under the trunk directory in repository. 25

PracKce- - - check out working copys cd ~ - - - - go back to your home directory mkdir svnworking1 - - - make a working directory for developer 1 mkdir svnworking2 - - - - make a working directory for developer 2 pwd svn co file:///the_pwd_result/svnrepo/ ~/ svnworking1/ - - - - check out a working copy pretending be developer 1. ls svnworking1 - - - check new files in the directory ls svnworking1/trunk/ - - - check new files in the directory 26

PracKce- - - modify project and check in as Dev1 cd svnworking1/trunk vi try.txt - - - edit the file. - - - - go inside the directory. - - - - - now change the second line by adding something at its end. And save it and quit vi. svn status - - - - will see M try.txt. M stands for modified svn ci m change the second line - - - check in! 27

PracKce as Dev2 cd ~ pwd svn co file:///the_pwd_result/svnrepo/ ~/ svnworking2/ - - - - check out a working copy pretending be developer 2. ls svnworking2 ls svnworking2/trunk/ cd svnworking2/trunk/ vi try.txt - - - change the third line of the file by adding something at its end and then save the file and quit vi. svn ci m dev2 changed line 3 - - - check in! 28

PracKce - - - create a conflict cd ~ /svnworking1/trunk/ - - - - pretend as Dev1 vi try.txt - - - - - change the line 3 differently as Developer 2. And save the file and quit vi. svn ci m dev1 changed line 3 too - - - check in! - - - - Commit failed!!!- - - out of date!!! svn update - - - - has to update now! - - - - will see C try.txt means there is a conflict with try.txt ls - - - - Svn put 3 extra files in the directory and now 4 files are in the directory: try.txt try.txt.mine try.txt.r3 try.txt.r4 29

The Content of try.txt ARer Conflict the first line--remain the same the second line-- will change it.i add a word <<<<<<<.mine the third line-- will change it dev1 ======= the third line-- will change it dev2 add >>>>>>>.r4 the forth line--remain the same the fifth line--will change it the sixth line--will change and add a new line below the seventh line---remain the same the eighth line --will be deleted the ninth line --will be deleted the tenth line--remain the same then add some new lines. 30

PracKce - - - resolve the conflict vi try.txt - - - - - remove <<<<< ===== and >>>>> and make your decision what the final version should be! Save the file and quit vi. rm try.txt.* - - - - remove the three files: try.txt.mine try.txt.r3 try.txt.r4 that marked as conflict occurs. svn ci m dev1 resolve a conflict - - - check in! Congratulations!!! 31