Assembla offers reliable feature-packed Subversion hosting service. This guide provides advanced information on working with Assembla hosted Subversion repositories.
1. Downloading a dump file of an Assembla hosted SVN repository
To download a dump file of your Assembla hosted SVN repository:
- Go the SVN tab for the repository you wish to export, then go to the Import/Export sub-tab
- Click the Generate Repository dump button.
An export job will be scheduled and run in the background. This job will create a compressed dump file of the repository and place it in a temporary folder on the server. A link to download the file will appear in the Import/Export page and it will be available for 24 hours.
What is a Subversion (SVN) dump file?
A repository dump stream (often referred to as a “dump file” when stored as a file on disk) is a portable, flat file format that describes the various revisions in your repository—what was changed, by whom, when, and so on. This dump stream is the primary mechanism used to marshal versioned history—in whole or in part, with or without modification—between repositories.
2. How to update tickets from commit comments
You can use commit messages to add comments to tickets or change their status.
Linking commits to tickets
Using the syntax below you can add an event in the ticket's activity that includes a link to the commit.
re #4 to link your commit to ticket #4.
Also, "references", "refs" and "see" will add a comment to the target ticket.
Change a ticket status from a commit message
#4 to set ticket #4 to the target status. For example,
Test #4 or
re #tickets to reference all affected tickets in merge request.
3. Using Merge Requests (MR)
A Merge Request is a way to submit a piece of code (or a set of changes in files) for review before that code is actually committed to the repository. The reviewer(s), who will be team members in the space, would review the submitted changes and, if accepted, the reviewer can authorize the merge. Merge requests are used in conjunction with the Protected directories feature to control code commits in the the protected directory.
If you want to use this feature you must disable the new UI from your SVN Settings page by marking the option "Use old UI for the Merge Requests (Reviews) workflow".
3.1 Creating a Merge Request (MR)
You would commit your proposed changes to a branch other than the main branch where (if accepted) the proposed changes will be merged.
To learn more about branching in SVN refer to Using Branches chapter in the SVN RedBook.
To submit a merger request:
- Go to the Merge Requests sub-tab on the SVN repository and click the New Merge Request button
- Specify the source branch in From and destination branches in To and click Create Merge Request button.
- In the message, type a title and a description for the reviewer about the proposed changes and click Create merge request button. A merge request will be added in the Merge Requests tab.
- In the description type the ticket numbers affected by the merge request using the syntax "re #ticket_number" or "ref #ticket_number as described in the section on linking tickets to code commits.
- You can also specify if the branch should be deleted after the changes are merged by checking on the option "Delete branch_name after merge request is merged or ignored.
3.2 Reviewing a proposed Merge Request
Once a Merge Request is initialized, it appears in the Merge Request sub-tab of the SVN repository. In the Merge Request sub-tab you can see the various pending Merge Requests. For each Merge Request entry you can immediately see the source and destination branches listed below the title. The current votes appear on the right. The screen defaults to only showing your Open Merged Requests, to view the Merged or Ignored requests, click on the buttons to toggle them on/off. You can filter by requestor in the drop down menu.
Viewing a Merge Request
To open a Merge Request, just click on the MR summary in the Merge Requests sub-tab. On the Merge Request details page you will see various information and details about the Merge Request.
- Get Changes: Clicking this link reveals instructions on how to get the changes merged in your working copy.
- Before Merge: This link provide a notice that you should update the branch from the master before proceeding with the merge.
- Merge and Close button: Click this button to merge proposed changes in the destination repository.
- Ignore button: Puts the Merge Request in the ignored tab.
- Versions: Instead of submitting a new Merge Request when you make additional changes, you can submit a new version.
- The Discussion tab: Here you can add a comment and view other contributors comments on the Merge request.
- The Commits tab: It’s a list of all your commits to the involved branches.
- The Files affected tab: From this tab you can view diff for each file affected by the proposed changes.
- The Tickets Affected tab: This tab allows you to know exactly what tickets are being affected by the changesets in this Merge Request.
- The Followers tab: Just like tickets, merge requests can have followers. From the followers tab you can add and remove followers. Followers are notified about changes by email, if they have enabled notification for Merge request events from the Stream -> Email notifications.
- Votes: Team members can vote up and down a merge request by simply clicking the +1 or -1 buttons on the top. When down voting a voter must add a comment.
3.3 Merge requests from ticket Perspective
Any ticket that is affected by a merge request will get a new Merge Requests sub-tab. This sub-tab is a place where your team members can easily follow the code that affects a specific ticket. They can see where, when and by whom the code was merged or ignored. They can see what is the current status of the code associated with the ticket, not just the ticket status.
4. Protected Directories
Protected Directories adds Access Control List (ACL) to Subversion directories. ACL allows you to restrict directories so that only certain team members have write permission.
To protect a directory:
- Go to the Setting sub-tab on the SVN repository tab, then click the Protected Directories link on the left side. You must be an "Owner" on the project to view the Settings sub-tab
- In the Directory Path enter the relative path to the directory, for example "trunk"
- In Grant write permission to... field type the usernames for the team members who will be allowed write permission. Other team members will be able to view the protected directory content.
- Finally click Protect Directory
Team members who are allowed access to the protected directory will see the directory marked with a green lock icon. Other team members will see it marked with a red lock icon.
To remove directory protection from a directory or to edit it use the red delete icon and edit icon appearing to the right of the protected directory entry.
5. Server-Side Hooks
Server Side Hooks is a powerful feature that allow you to control your repository. With Server Side Hooks you can syntax check code, ensure commit messages are proper, or add the power of automation. You can add pre-commit, post-commit, pre-revprop-change and post-revprop-change hooks to your Subversion repository.
To add a Server Side Hook to your Assembla repository go to the repository's Settings sub-tab then click Server Side Hooks link on the left. You can install any of the read-made script made available by Assembla by clicking the Install button next to the script. You can see a list of available scripts and view the script code in this page.
Also, you can submit your own Server-Side hook by clicking the Propose hook button. Our development team will review the submitted code first and, once approved, they will add it to your repository.
6. Using svn+ssh Protocol
Assembla support connecting to SVN repositories using SVN+SSH protocol which provides security advantages. In this section we will discuss how you can setup your SVN client to use this protocol on Linux and Mac computer and on Windows computers
6.1 Configure a console SVN client on Linux or MacOS
Let's say you already have subversion repository in your Assembla space and you want to configure your console subversion client on Linux or MacOS to work with it.
As you can see on the picture above there is "demo-test" subversion repository added to "DemoSpaceTest".
1. Generate ssh keys
You can do it by running ssh-keygen -t dsa. It will ask you where to store the key (by default it is ~/.ssh/id_dsa) and for passphrase to protect private key from unauthorized access (no passphrase by default).
2. Generate ssh keys Upload public key to your Assembla Account
You can see your public key with cat ~/.ssh/id_dsa.pub. Copy the output of this command, go to SSH Keys Settings page in your Assembla profile and paste your public key contents there:
3. Modify ssh config
Add the following lines to ~/.ssh/config
Host subversion.assembla.com User svn SendEnv REPO_NAME
Now you can set REPO_NAME var and checkout your repository using svn+ssh:
svn co svn+ssh://subversion.assembla.com/
You need to export REPO_NAME var only once, however you can set it directly before every svn command:
REPO_NAME=demo-test svn co svn+ssh://subversion.assembla.com/trunk/
6.2 Configure TortoiseSVN and PuTTY on Windows
Let's say you already have subversion repository in your Assembla space and you want to configure your TortoiseSVN subversion client on Windows to work with it.
As you can see on the picture above there is "ie9test" subversion repository added to "DemoSpaceTest".
1. Download PuTTY
You can download installer with this direct link. Installation is pretty straightforward, new programs will be put into "C:/Program Files/Putty", shortcuts will appear in start menu.
2. Generate SSH keys
Start > Programs > PuTTY > PuTTYgen.
In PuTTYgen, first click on the "Generate" button.
Next, you'll move your mouse around the big gray area under the progress bar to generate randomness for super security.
Once the key is generated, you should copy it onto your clipboard. You'll use this later to authenticate with Assembla.
Lastly, click on the "Save private key" button and save your private key somewhere you'll remember.
3. Upload public key to your Assembla account
Go to SSH Keys Settings page in your Assembla profile and paste the public key you just copied from the previous step:
4. Configure PuTTY
Add subversion.assembla.com as Host Name:
Then go to Connection -> Data section and set Auto-login username to svn.
In Environment variables section add REPO_NAME var with your repo name value (demoportfolio^ie9test in our case):
Then go to Connection -> SSH -> Auth section and browse private key you saved at Step 2.
Finally, you can return to Session section and save your connection profile, you can put your repo name on it (ie9test in our case), for better organization.
5. Configure TortoiseSVN
Start > Programs > TortoiseSVN > Settings.
Go to Network section and set SSH client to "C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe"
Now you can checkout using TortoiseSVN!
Use your PuTTY connection profile name from Step 4 in URL of repository field:
If you have any questions or need assistance, please email us at firstname.lastname@example.org.