<html>
    <head>
        <meta name="viewport" content="width=device-width" />
        <base href="https://wiki.asterisk.org/wiki" />
        <style type="text/css">
    body, #email-content, #email-content-inner { font-family: Arial,FreeSans,Helvetica,sans-serif; }
    body, p, blockquote, pre, code, td, th, li, dt, dd { font-size: 13px; }
    small { font-size: 11px; }

    body { width:100% !important; -webkit-font-smoothing: antialiased; }

    body,
    #email-wrapper { background-color: #f0f0f0; }
    #email-wrapper-inner { padding: 20px; text-align: center; }
    #email-content-inner { background-color: #fff; border: 1px solid #bbb; color: $menuTxtColour; padding:20px; text-align:left; }
    #email-wrapper-inner > table { width: 100%; }
    #email-wrapper-inner.thin > table { margin: 0 auto; width: 50%; }
    #email-footer { padding: 0 16px 32px 16px; margin: 0; }

    .email-indent { margin: 8px 0 16px 0; }
    .email-comment { margin: 0 0 0 56px; }
    .email-comment.removed { background-color: #ffe7e7; border: 1px solid #df9898; padding: 0 8px;}

    #email-title-avatar { text-align: left; vertical-align: top; width: 48px; padding-right: 8px; }
    #email-title-flavor { margin: 0; padding: 0 0 4px 0; }
    #email-title-heading { font-size: 16px; line-height: 20px; min-height: 20px; margin: 0; padding: 0; }
    #email-title .icon { border: 0; padding: 0 5px 0 0; text-align: left; vertical-align: middle; }

    #email-actions { border-top: 1px solid #bbb; color: #505050; margin: 8px 0 0 0; padding: 0; }
    #email-actions td { padding-top: 8px; }
    #email-actions .left { max-width: 45%; text-align: left; }
    #email-actions .right { text-align: right; }
    .email-reply-divider { border-top: 1px solid #bbb; color: #505050; margin: 32px 0 8px 0; padding: 8px 0; }
    .email-section-title { border-bottom: 1px solid #bbb; margin: 8px 0; padding: 8px 0 0 0; }

    .email-metadata { color: #505050; }

    a { color: #326ca6; text-decoration: none; }
    a:hover { color: #336ca6; text-decoration: underline; }
    a:active {color: #326ca6; }

    a.email-footer-link { color: #505050; font-size: 11px; }

    .email-item-list { list-style: none; margin: 4px 0; padding-left: 0; }
    .email-item-list li { list-style: none; margin: 0; padding: 4px 0; }
    .email-list-divider { color: #505050; padding: 0 0.35em; }
    .email-operation-icon { padding-right: 5px; }

    .avatar { -ms-interpolation-mode: bicubic; border-radius: 3px;}
    .avatar-link { margin: 2px; }

    .tableview th { border-bottom: 1px solid #69C; font-weight: bold; text-align: left; }
    .tableview td { border-bottom: 1px solid #bbbbbb; text-align: left; padding: 4px 16px 4px 0; }

    .aui-message {  margin: 1em 0; padding: 8px; }
    .aui-message.info { background-color: #e0f0ff; border: 1px solid #9eb6d4; }
    .aui-message.success { background-color: #ddfade; border: 1px solid #93c49f; }
    .aui-message.error,
    .aui-message.removed { background-color: #ffe7e7; border: 1px solid #df9898; color: #000; }

    .call-to-action-table { margin: 10px 1px 1px 1px;}
    .call-to-cancel-container, .call-to-action-container { padding: 5px 20px; }
    .call-to-cancel-container { border: 1px solid #aaa; background-color: #eee; border-radius: 3px; }
    .call-to-cancel-container a.call-to-cancel-button { background-color: #eee; font-size: 14px; line-height: 1; padding: 0; margin: 0; color: #666; font-family: sans-serif;}
    .call-to-action-container { border: 1px solid #486582;  background-color: #3068A2; border-radius: 3px; padding: 4px 10px; }
    .call-to-action-container a.call-to-action-button { background-color: #3068A2; font-size: 14px; line-height: 1; padding: 0; margin: 0; color: #fff; font-weight: bold; font-family: sans-serif; }

    /** The span around the inline task checkbox image */
    .diff-inline-task-overlay {
        display: inline-block;
        text-align: center;
        height: 1.5em;
        padding: 5px 0px 1px 5px;
        margin-right: 5px;
        /** Unfortunately, the negative margin-left is stripped out in gmail */
        margin-left: -5px;
    }

            @media handheld, only screen and (max-device-width: 480px) {
        div, a, p, td, th, li, dt, dd { -webkit-text-size-adjust: auto; }
        small, small a { -webkit-text-size-adjust: 90%; }

        td[id=email-wrapper-inner] { padding: 2px !important; }
        td[id=email-content-inner] { padding: 8px !important; }
        td[id="email-wrapper-inner"][class="thin"] > table { text-align: left !important; width: 100% !important; }
        td[id=email-footer] { padding: 8px 12px !important; }
        div[class=email-indent] { margin: 8px 0px !important; }
        div[class=email-comment] { margin: 0 !important; }

        p[id=email-title-flavor] a { display: block; } /* puts the username and the action on separate lines */
        p[id=email-permalink] { padding: 4px 0 0 0 !important; }

        table[id=email-actions] td { padding-top: 0 !important; }
        table[id=email-actions] td.right { text-align: right !important; }
        table[id=email-actions] .email-list-item { display: block; margin: 1em 0 !important; word-wrap: normal !important; }
        span[class=email-list-divider] { display: none; }
    }



        </style>
    </head>
    <body style="font-family: Arial, FreeSans, Helvetica, sans-serif; font-size: 13px; width: 100%; -webkit-font-smoothing: antialiased; background-color: #f0f0f0">
        <table id="email-wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" style="background-color: #f0f0f0">
            <tbody>
                <tr valign="middle">
                    <td id="email-wrapper-inner" style="font-size: 13px; padding: 20px; text-align: center">
                        <table id="email-content" cellspacing="0" cellpadding="0" border="0" style="font-family: Arial, FreeSans, Helvetica, sans-serif; width: 100%">
                            <tbody>
                                <tr valign="top">
                                    <td id="email-content-inner" align="left" style="font-family: Arial, FreeSans, Helvetica, sans-serif; font-size: 13px; background-color: #fff; border: 1px solid #bbb; padding: 20px; text-align: left">
                                        <table id="email-title" cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tbody>
                                                <tr>
                                                    <td id="email-title-avatar" rowspan="2" style="font-size: 13px; text-align: left; vertical-align: top; width: 48px; padding-right: 8px"> <img class="avatar" src="cid:avatar_0a3f104bbbd28b23672599c662d51642" border="0" height="48" width="48" style="-ms-interpolation-mode: bicubic; border-radius: 3px" /> </td>
                                                    <td valign="top" style="font-size: 13px">
                                                        <div id="email-title-flavor" class="email-metadata" style="margin: 0; padding: 0 0 4px 0; color: #505050">
                                                            <a href="    https://wiki.asterisk.org/wiki/display/~wdoekes " style="color:#326ca6;text-decoration:none;; color: #326ca6; text-decoration: none">Walter Doekes</a> edited the page:
                                                        </div> </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top" style="font-size: 13px"> <h2 id="email-title-heading" style="font-size: 16px; line-height: 20px; min-height: 20px; margin: 0; padding: 0"> <a href="https://wiki.asterisk.org/wiki/display/AST/Subversion+Usage" style="color: #326ca6; text-decoration: none"> <img class="icon" src="cid:page-icon" alt="" style="border: 0; padding: 0 5px 0 0; text-align: left; vertical-align: middle" /> <strong style="font-size:16px;line-height:20px;vertical-align:top;">Subversion Usage</strong> </a> </h2> </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <div class="email-indent" style="margin: 8px 0 16px 0">
                                            <p class="aui-message info" style="font-size: 13px; margin: 1em 0; padding: 8px; background-color: #e0f0ff; border: 1px solid #9eb6d4"> <b>Comment:</b> After repotools-r870 it is not necessary to disable interactive-conflicts: https://reviewboard.asterisk.org/r/2914/ </p>
                                            <div class="email-diff">
                                                <div id="page-diffs" class="wiki-content">
                                                    <table class="diff-macro diff-block-target" style="background-color: #f0f0f0;border: 1px solid #dddddd;margin: 10px 1px;padding: 0 2px 2px;width: 100%;">
                                                        <thead>
                                                            <tr>
                                                                <th class="diff-macro-title" style="background-color: transparent; text-align: left; font-weight: normal;padding: 5px;; font-size: 13px"><span class="icon macro-placeholder-icon" style="background-color: ;line-height: 20px;"><img src="https://wiki.asterisk.org/wiki/s/en_GB-1988229788/4252/6ac85e9b14675c5514a674e1aecae99c9505ed36.48/_/images/icons/macrobrowser/macro-placeholder-default.png" style="padding-right: 5px; vertical-align: text-bottom;" /> </span>Wiki Markup</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <tr>
                                                                <td class="diff-macro-body" style="background-color: #fff;border: 1px solid #dddddd;padding: 10px;; font-size: 13px"> <pre style="font-size: 13px">{numberedheadings}

{toc}

h1. Commit Access

h2. Configuration

The subversion server uses SSL client certificates to handle authentication of users.  When you are granted commit access, you will be provided two files.  These files should be placed in your {{~/.subversion/}} directory.

# [Digium_SVN-cacert-sha1.pem|http://svnview.digium.com/svn/repotools/Digium_SVN-cacert-sha1.pem]
# <name>-cert.p12

The following should be placed in the {{~/.subversion/servers}} file:

{code:title=~/.subversion/servers}
[groups]
digium = *.digium.com

[digium]
ssl-client-cert-file = /home/<username>/.subversion/<name>-cert.p12

[global]
ssl-authority-files = /home/<username>/.subversion/Digium_SVN-cacert-sha1.pem
{code}

<span class="diff-html-removed" id="removed-diff-0" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">It is also recommended that you add the following to the {{~/.subversion/config}} file.  Otherwise, the merge scripts will hang waiting for input while trying to merge between branches.

{code:title=~/.subversion/config}
[miscellany]
interactive-conflicts=no
{code}

</span>h2. SVN Checkouts

Checkouts that come from {{http://svn.asterisk.org/}} are read-only copies of the repositories.  When doing a checkout that you intend to commit to, it must be from {{https://origsvn.digium.com/}}.  For example:

{code:bash}
$ svn co https://origsvn.digium.com/svn/asterisk/trunk
$ svn co https://origsvn.digium.com/svn/asterisk/branches/1.8
{code}

h1. Using {{svnmerge}} for Cross-Branch Merging

h2. Tools Installation

You must install {{svnmerge}} and the related wrappers from our {{repotools}} repository.  The wrapper scripts use {{expect}}, so be sure to install that, too.

{code:bash}
$ svn co http://svn.asterisk.org/svn/repotools
$ cd repotools
$ ./configure
$ sudo make install
{code}

h2. {{svnmerge}} Properties

If you do a {{svn pl -v}} while you are located in an svn checkout, you will see all the properties currently attached to the root directory. For instance, on a checked out copy of Asterisk trunk, you will see something like this:

{noformat}
  branch-1.8-blocked
    /branches/1.8:
  branch-1.8-merged
    /branches/1.8:1-279056,279113,279227,279273,279280,...............,286457
{noformat}

and on the 1.8 branch, you will see these sort of properties:

{noformat}
  branch-1.6.2-blocked
    /branches/1.6.2:279852,279883,280227,280556,280812,282668
  branch-1.6.2-merged
    /branches/1.6.2:1-279056,279207,279501,279561,279597,279609,....................,286268
{noformat}

These properties identify the following things:
# The branch changes are being merged from
** {{branch-<branch>-...}}
# The revisions merged from that branch
** {{branch-<branch>-merged:/branches/<branch>:<revisions>}}
# The revision explicitly not merged, or blocked, from that branch
** {{branch-<branch>-blocked:/branches/<branch>:<revisions>}}

h2. Branch Merging Order

When committing a change that applies to more than one branch, the change should first go into the oldest branch and will then be merged up to the next one.  If a branch is reached where the change should not be merged up, it should be explicitly blocked.  The following diagram shows the current branch merge order.

The column on the right describes the scripts you will use to merge between versions or block specific versions from merging.

{section}
{column:width=25%}
{flowchart}
"/svn/asterisk/branches/1.8" -> "/svn/asterisk/branches/11"
"/svn/asterisk/branches/11" -> "/svn/asterisk/branches/12"
"/svn/asterisk/branches/12" -> "/svn/asterisk/trunk"
{flowchart}
{column}
{column:width=75%}
* 1.8 -> 11
** {{merge811 _<revision>_}}
** {{block811 _<revision>_}}

* 11 -> 12
** {{merge1112 _<revision>_}}
** {{block1112 _<revision>_}}
* 12 -> trunk
** {{merge12trunk _<revision>_}}
** {{block12trunk _<revision>_}}

The <revision> number passed to each script should be the revision resulting from the commit to an older branch. The script would be run from the checkout directory for the Asterisk version you are merging *to*.

For example if you have committed a change to 11 and that needs to be merged through to trunk, the commands would look similar to the following:

{noformat}
/svn-asterisk-11$ svn commit -F ../commit_msg
Sending        apps/app_voicemail.c
Transmitting file data .
Committed revision 376262.
/svn-asterisk-11$ cd ../svn-asterisk-trunk
/svn-asterisk-trunk$ merge11trunk 376262
{noformat}

Then you would proceed with committing the merged changes.

{tip}
All of these scripts create a commit message for you in the file {{../merge.msg}}.  Run "{{svn commit}}" and use that commit message with the following command:
{code:bash}
$ svn commit -F ../merge.msg
{code}
{tip}

{tip}
Sometimes when you go to commit your changes after merging from another branch, you will end up with a conflict. The conflict will typically be against {{.}} (period). To resolve the conflict, run "{{svn resolved .}}" prior to committing.
{tip}

{column}
{section}

h2. Backporting Changes

Sometimes a change is made in a branch and later it is decided that it should be backported to an older branch.  For example, a change may have gone into the 11 branch and later needs to be backported to the 1.8 branch.  To handle this, first manually make the change and commit to the 1.8 branch.  Then, there is another wrapper similar to {{merge811}} and {{block811}} to record that the code from a revision already exists in the 11 branch.  The wrapper is {{record811}}.

{code:bash}
$ cd 11
$ record811 <revision>
$ svn commit -F ../merge.msg
{code}

h1. Developer Branches

{info}
If you have been granted workspace on the server, you will have read and [electronically signed the Open Source Contributor License|https://issues.asterisk.org/] found at https://issues.asterisk.org (upon signing in) and have been given an SSL client certificate.
{info}

Developer branches are stored in the {{/team/<name>}} directory of each project repository (and {{/team/<name>/private}} for private branches).

h2. Creating a Developer Branch

Use the following commands to create a branch and prepare it for future merge tracking of the branch you created it from.  This example creates a branch off of Asterisk trunk.

{code:bash}
$ svn copy https://origsvn.digium.com/svn/asterisk/trunk https://origsvn.digium.com/svn/asterisk/team/jdoe/my-fun-branch
$ svn checkout https://origsvn.digium.com/svn/asterisk/team/jdoe/my-fun-branch
$ cd my-fun-branch
$ svnmerge init
$ svn commit -F svnmerge-commit-message.txt
{code}

h2. Deleting a Developer Branch

To delete a developer branch after you are done with it use the SVN command shown below for your branch name.

{code:bash}
$ svn delete https://origsvn.digium.com/svn/asterisk/team/jdoe/my-fun-branch
{code}

h2. Group Branches

Group branches are developer branches intended to be worked on by more than one developer.  Instead of putting them in {{/team/<name>}}, they go in the {{/team/group}} directory, instead.  Otherwise, they're managed in the exact same way as other developer branches.

h2. Automatically Keeping Branches Up to Date Using {{automerge}}

Our subversion server provides the ability to automatically keep developer branches up to date with their parent.  To enable this feature, set the {{automerge}} and {{automerge-email}} properties on the root directory.  Changes from the parent branch will be periodically (once an hour) merged into your branch.  If a change from upstream conflicts with changes in the branch, the {{automerge}} process will stop and the address(es) listed in the {{automerge-email}} property will be notified.

{note}
Running {{svnmerge init}} and committing those properties is a prerequisite for {{automerge}} to work for a developer branch.
{note}

Use the following commands to enable automerge on a developer branch:

{code:bash}
$ cd my-fun-branch
$ svn ps automerge '*' .
$ svn ps automerge-email 'me@example.com' .
$ svn commit -m "initialize automerge"
{code}

h3. Setting {{automerge-email}} on a Group Branch

For a branch with multiple developers working on it, it may be useful to have automerge emails sent to more than one email address.  To do so, just separate the email addresses in the property with commas.  The value of this property is literally used as the content for the {{To:}} header of the email.

{code:bash}
$ svn ps automerge-email 'me@example.com,you@example.com,him@example.com' .
{code}

h3. Resolving {{automerge}} Conflicts

If your developer branch goes into conflict with {{automerge}} on, and the {{automerge-email}} property has been set, you will receive an email notifying you of the conflict and {{automerge}} will be disabled.  To resolve it, use the following commands:

{code:bash}
$ cd my-branch
$ svn update
$ svnmerge merge
{code}

Running the {{svnmerge}} tool will merge in the changes that cause your branch to go into conflict into your local copy.  Edit the files that are in conflict to resolve the problems as appropriate.  Finally, tell SVN that you have resolved the problem, re-enable automerge, and commit.

{code:bash}
$ svn resolved path/to/conflicted/file
$ svn ps automerge '*' .
$ svn commit -m "resolve conflict, enable automerge"
{code}

h2. Private Branches

A private developer branch is only visible to Digium and the branch owner.  Management of a private branch is exactly the same as any other developer branch.  The only difference is branch location.  Instead of putting the branch in {{/team/<name>/}} the branch goes in {{/team/<name>/private/}}.

h2. Merging a Developer Branch into {{trunk}}

{info}
If your branch contains new functionality, please make sure you have made the appropriate modifications to {{CHANGES}} and/or {{UPGRADE.txt}}.
{info}

If a developer has a branch that is ready to be merged back into the trunk, here is the process:

{code:bash}
$ svn co https://origsvn.digium.com/svn/asterisk/trunk
$ cd trunk
$ svn merge --ignore-ancestry https://origsvn.digium.com/svn/asterisk/trunk https://origsvn.digium.com/svn/asterisk/team/jdoe/bug12345 .
# Check the diff to see if it merged properly
$ svn diff | less
{code}

Be sure to check the resulting diff to make sure that the merge doesn't overwrite any changes in trunk. If it does, you will have to specify the specific revisions merge needs to base its diff off of.

{code:bash}
# The last change to bug12345 was at r2500.
# trunk r2400 was merged into bug12345@2500.
$ svn merge --ignore-ancestry https://origsvn.digium.com/svn/asterisk/trunk@2400 https://origsvn.digium.com/svn/asterisk/team/jdoe/bug12345@2500 .
{code}

{note}
This is NOT using the svnmerge script; this is just a normal SVN merge.
{note}

Once this is done, the working copy will contain the trunk plus the changes from the developer branch.  If you follow the above instructions for creating branches, you have probably introduced  properties to the root of the branch that need to be removed.

{code:bash}
$ svn revert .
{code}

If you are purposely introducing new properties, or  purposely introducing new values for existing properties, then you might do the following instead, so as not to destroy your properties:

{code:bash}
$ svn pd svnmerge-integrated .
$ svn pd automerge .
$ svn pd automerge-email .
{code}

If everything merged cleanly, you can test compile and then:

{code:bash}
$ svn commit -m "Merge branch for issue 12345"
{code}

Once the contents of your branch has been merged, please use {{svn remove}} to remove it from the repository.  It will still be accessible if needed by looking back in the repository history if needed.

{numberedheadings}</pre> </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                        <table id="email-actions" class="email-metadata" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-top: 1px solid #bbb; color: #505050; margin: 8px 0 0 0; padding: 0; color: #505050">
                                            <tbody>
                                                <tr>
                                                    <td class="left" valign="top" style="font-size: 13px; padding-top: 8px; max-width: 45%; text-align: left"> <span class="email-list-item"><a href="https://wiki.asterisk.org/wiki/display/AST/Subversion+Usage" style="color: #326ca6; text-decoration: none">View Online</a> </span> <span class="email-list-divider" style="color: #505050; padding: 0 0.350em">·</span> <span class="email-list-item"><a href="https://wiki.asterisk.org/wiki/plugins/likes/like.action?contentId=5243336" style="color: #326ca6; text-decoration: none">Like</a> </span> <span class="email-list-divider" style="color: #505050; padding: 0 0.350em">·</span> <span class="email-list-item"><a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=5243336&revisedVersion=58&originalVersion=57" style="color: #326ca6; text-decoration: none">View Changes</a> </span> <span class="email-list-divider" style="color: #505050; padding: 0 0.350em">·</span> <span class="email-list-item"><a href="https://wiki.asterisk.org/wiki/display/AST/Subversion+Usage?showComments=true&showCommentArea=true#addcomment" style="color: #326ca6; text-decoration: none">Add Comment</a> </span> </td>
                                                    <td class="right" width="50%" valign="top" style="font-size: 13px; padding-top: 8px; text-align: right"> <span class="email-list-item"><a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST" style="color: #326ca6; text-decoration: none">Stop watching space</a> </span> <span class="email-list-divider" style="color: #505050; padding: 0 0.350em">·</span> <span class="email-list-item"><a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action" style="color: #326ca6; text-decoration: none">Manage Notifications</a> </span> </td>
                                                </tr>
                                            </tbody>
                                        </table> </td>
                                </tr>
                            </tbody>
                        </table> </td>
                </tr>
                <tr>
                    <td id="email-footer" align="center" style="font-size: 13px; padding: 0 16px 32px 16px; margin: 0"> <small style="font-size: 11px"> This message was sent by <a class="email-footer-link" style="color:#505050;font-size:11px;text-decoration:none;; color: #326ca6; text-decoration: none; color: #505050; font-size: 11px" href="http://www.atlassian.com/software/confluence">Atlassian Confluence</a> 5.1.5, <a class="email-footer-link" style="color:#505050;font-size:11px;text-decoration:none;; color: #326ca6; text-decoration: none; color: #505050; font-size: 11px" href="http://www.atlassian.com/software/confluence/overview/team-collaboration-software?utm_source=email-footer">Team Collaboration Software</a> </small> </td>
                </tr>
            </tbody>
        </table>
    </body>
</html>