I use Assembla to manage my Subversion repository. I have started some major revisions to my codebase and want to create a Tag of my most recent production revision ( which I forgot to do when I pushed that rev live to production a few weeks ago ).
I'm currently on revision 588, and want to create a Tag of revision 577. How do I go about doing this from the command line using Subversion within Assembla?
Assume my Assembla SVN URL is: https://subversion.assembla.com/svn/my_assembla_svn_directory/
You can always use the -r
parameter to refer to a specific revision. When doing so, you can also use the @rev
revision pinning to make sure you're referring to the layout of the Subversion revision at a particular revision. The following will create a tag from trunk on revision 577 and call this tag REV-1.2
:
$ svn cp -r 577 https://subversion.assembla.com/svn/my_assembla_svn_directory/trunk https://subversion.assembla.com/svn/my_assembla_svn_directory/tags/REV-1.2
If you don't have a trunk
, branches
, and tags
directories, you'll need to move your work in order to create some:
$ # Move the current directory to the "trunk" $ svn cp https://subversion.assembla.com/svn/my_assembla_svn_directory \ https://subversion.assembla.com/svn/my_assembla_svn_directory/trunk $ # Make a corresponding tags and branches directories too $ svn mkdir https://subversion.assembla.com/svn/my_assembla_svn_directory/branches $ svn mkdir https://subversion.assembla.com/svn/my_assembla_svn_directory/tags $ # Now, we can delete the old location. Let your developers know this, $ # so they're not surprised by this and will be able to do a "svn relocate" $ svn delete https://subversion.assembla.com/svn/my_assembla_svn_directory/ $ # Whoops. I should have done the tagging when I had a chance. $ #Oh well, we'll use the `@rev` pinning: $ svn -r557 cp https://subversion.assembla.com/svn/my_assembla_svn_directory@557 \ https://subversion.assembla.com/svn/my_assembla_svn_directory/tags/REL-1.2
Subversion doesn't implement tagging and branching except as a copy. This isn't unusual. Perforce implements branching in the same way. In fact, once you get use to it, it works out really well:
svn ls
on the right directoryStraight from the SVN documentation:
If you want to create a snapshot of /calc/trunk exactly as it looks in the HEAD revision, make a copy of it:
$ svn copy http://svn.example.com/repos/calc/trunk \ http://svn.example.com/repos/calc/tags/release-1.0 \ -m "Tagging the 1.0 release of the 'calc' project." Committed revision 902.
This example assumes that a /calc/tags directory already exists. (If it doesn't, you can create it using svn mkdir.) After the copy completes, the new release-1.0 directory is forever a snapshot of how the /trunk directory looked in the HEAD revision at the time you made the copy. Of course, you might want to be more precise about exactly which revision you copy, in case somebody else may have committed changes to the project when you weren't looking. So if you know that revision 901 of /calc/trunk is exactly the snapshot you want, you can specify it by passing -r 901 to the svn copy command.
(emphasis mine)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With