Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: Learning How to Use CVS for Personal Perl Coding Practices

by Rhose (Priest)
on Nov 03, 2005 at 15:13 UTC ( #505385=note: print w/replies, xml ) Need Help??

in reply to Re: Learning How to Use CVS for Personal Perl Coding Practices
in thread Learning How to Use CVS for Personal Perl Coding Practices

While there is nothing incorrect with your example, I've followed the suggestion of using trunk, tags, and branches, and have found it to be very helpful. (Use branches for parallel development... like migrating code to a new platform while development continues on the current one. Use tags for "point in time" snapshots.) I use this structure even for repositories for which I'm *sure* I'll never need them. (If, for no better reason, than to always know I need to check out the trunk on any given repo.)

You set this up before the initial import. Create a directory (let's assume /home/rhose/svn). In this directory, create three more directories -- trunk, tags, and branches. Place all your directories/code in the trunk directory.

cd /home/rhose mkdir svn cd svn mkdir trunk mkdir tags mkdir branches cd trunk cp /home/rhose/work/project123/* .

You are now ready to import. (Please note, I'm using the Subversion daemon in this example.)

svn import /home/rhose/svn svn://myserver/myrepo -m "Initial import"

You are now free to nuke your import structure, checkout the trunk, and start working. Also, I like to make a temporary copy of the original files until I verify the repo import worked correctly and everything is in there... I've never had a problem, but I tend to play it extra safe. (Please note... once you check out a repo, do NOT mess with the .svn directories -- like Bruce Banner, you'll not like them when they're angry.)

cd /home/rhose/svn rm -rf * cd /home/rhose/work mv project123 mkdir project123 cd project123 svn checkout svn://myserver/myrepo/trunk/ . vi svn commit -m "Made change XXX for project YYYY" cd .. rm -rf

If you are in a Windows environment, I'd like to second tphyahoo's advice -- TortoiseSVN is wonderful.

Replies are listed 'Best First'.
Re^3: Learning How to Use CVS for Personal Perl Coding Practices
by neversaint (Deacon) on Nov 03, 2005 at 16:57 UTC
    Dear Rhose,
    [snip] svn://myserver/myrepo [snip]
    Where and how do you set/define this server repository? Say if I am only working locally for myself.

    neversaint and everlastingly indebted.......
      Read chapters 1,2,3,5, and 6 of The SVN Book referenced in the posts above.

      Basically, instead of writing to a local file, you can share your repository (make it available for people on other computers) using a Subversion daemon or Apache. This takes a little bit of effort to set up, but it works well.

        If he is only using this for his own code and for code contributed by those with an account on the same machine then local repository access is sufficient. He can access it remotely (via ssh) with a url like svn+ssh://machine/path/to/repository

        - caedes

      The url for a local repository is file:///path/to/repository

      - caedes

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://505385]
choroba's discovered two instances of a weird animal in the code at work: \@$var
[Eily]: hum, tied scalar, generates a new array when derefed ? :D
[Corion]: choroba: Ah, when doing a shallow copy, I prefer [ @$var ] - I think \@$var might return the same reference instead of a reference to a fresh copy
[Corion]: perl -wle "my $ar = [1,2,3]; my $br=\@$ar; print qq($ar / $br)" confirms this to me

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (11)
As of 2017-09-26 08:43 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (293 votes). Check out past polls.