Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4e4f564f34b16063c673565ccd51d76194342c63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>Working with Branches (CDO Model Repository Documentation)</title>

<link rel="stylesheet" href="../book.css" charset="UTF-8" type="text/css">

<noscript></noscript>
<script type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Working with Branches (CDO Model Repository Documentation)";
    }
}
</script>
</head>

<body bgcolor="white" onload="windowTitle();">
<!-- <div class="help_breadcrumbs breadcrumbs_top"><a href="../Overview.html" title="CDO Model Repository Documentation">CDO Model Repository Documentation</a> > <a href="index.html" title="Category in CDO Model Repository Documentation">User's Guide</a></div> -->

<table border="0">
	<tr>
		<td width="100%"><h1>Working with Branches</h1></td>
		<td align="right" valign="middle" nowrap><a href="Doc02_ManagingRepositories.html" title="Backward to Managing Repositories"><img src="../../images/backward.png" border="0"></a>&nbsp;<a href="Doc04_CheckingOut.html" title="Forward to Checking Out from Repositories"><img src="../../images/forward.png" border="0"></a></td>
	</tr>
</table>
<p class="author">Author: Eike Stepper</p>
<p>
 <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranch.html" title="Interface in org.eclipse.emf.cdo.common.branch"><code>Branches</code></a> are a very powerful concept in CDO. They allow to isolate a sequence of commits from other
 sequences of commits, as well as all the locks on the objects that are involved. A branch is represented by a
 <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranch.html#getBase()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranch"><code>base point</code></a> and a <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranch.html#getName()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranch"><code>name</code></a>. The base point of a branch X is the
 <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html#getTimeStamp()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranchPoint"><code>timestamp</code></a> in the <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html#getBranch()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranchPoint"><code>parent branch</code></a> where the
 branch X forks off. As such all branches of a repository form a tree that is rooted at the
 <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchManager.html#getMainBranch()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranchManager"><code>main branch</code></a>, which itself has no proper base point (the base branch is
 <code>null</code> and the base time is identical to the <a href="../../javadoc/org/eclipse/emf/cdo/common/CDOCommonRepository.html#getCreationTime()" title="Method in org.eclipse.emf.cdo.common.CDOCommonRepository"><code>creation time</code></a> of the repository).
 <p>
 The branch tree of a repository is displayed under that repository in the <a href="Doc01_UserInterface.html#Doc_RepositoriesView" title="Chapter in CDO Model Repository Documentation">CDO Repositories View</a>. The main branch
 is always represented by the repository node itself. The displayed branch tree is updated in real-time even when other users
 create new branches or modify existing branches on their workstations.
 <p>
 Each repository has at least a main branch, but, to be able to work with branches in a meaningful way, the <i>versioning mode</i>
 of a repository must be set to <i>branching</i>. See <a href="../operators/Doc01_ConfiguringRepositories.html#Property_supportingBranches" title="Chapter in CDO Model Repository Documentation">Property supportingBranches</a>
 for instructions on how to do this for
 remote repositories or <a href="Doc02_ManagingRepositories.html#Doc_LocalRepositories" title="Chapter in CDO Model Repository Documentation">Creating Local Repositories</a> for instructions on how to do this for local repositories.
 <p>
 Note that the branching mode does usually not add much overhead in terms of storage consumption or processing time, but the
 branching mode always includes the functionality and the characteristics of the auditing mode; and that mode may significantly
 increase the size of the underlying database. In other words, using the auditing mode instead of the normal mode makes a big difference;
 using the branching mode instead of the auditing mode not.
 <p>
 <b>Table of Contents</b> <p>
<table border="0">
<tr><td>1&nbsp;</td><td class="te" colspan="3"><a href="Doc03_UsingBranches.html#Doc_CreatingBranches" title="Chapter in CDO Model Repository Documentation">Creating Branches</a></td></tr>
<tr><td>2&nbsp;</td><td class="te" colspan="3"><a href="Doc03_UsingBranches.html#Doc_RenamingBranches" title="Chapter in CDO Model Repository Documentation">Renaming Branches</a></td></tr>
<tr><td>3&nbsp;</td><td class="te" colspan="3"><a href="Doc03_UsingBranches.html#Doc_DeletingBranches" title="Chapter in CDO Model Repository Documentation">Deleting Branches</a></td></tr>
<tr><td>4&nbsp;</td><td class="te" colspan="3"><a href="Doc03_UsingBranches.html#Doc_BranchShowInHistory" title="Chapter in CDO Model Repository Documentation">Showing Branches in the History View</a></td></tr>
</table>
</p>


<h2><a name="Doc_CreatingBranches"></a>1&nbsp;&nbsp;Creating Branches</h2>
<p>
 There exist several ways to create new branches. The most explicit way is to use <a href="Doc01_UserInterface.html#Doc_RepositoriesView" title="Chapter in CDO Model Repository Documentation">CDO Repositories View</a>,
 select a repository (with versioning mode set to branching) or an existing branch under that repository,
 open the context menu on that repository or branch and select the New Branch action. The following dialog will pop up:
 <p align="center"><img src="branch-create.png">

 <p>
 The upper part of the dialog shows the current branch tree of the targeted repository.
 The <b>base branch</b> of the new branch can be changed if needed.
 <p>
 The <b>base time stamp</b> must be specified. Three different options exist:
 <ul>
 <li> <b>Base</b> refers to the time stamp of the base point of the branch selected in the upper branch tree.
      That means the resulting new branch  will fork of the selected base branch at the same time when that base branch was forked off
      of its own base branch.
 <li> <b>Time</b> allows to enter any valid time stamp. Invalid time stamps are those that are before the creation of the base branch
      or after the current time.
 <li> <b>Head</b> refers to the current time. Note that the <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranch.html#getHead()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranch"><code>head</code></a> of a branch is a floating branch point,
      i.e., it always point to the current time in a branch. Nevertheless selecting this option will set the base time stamp of the
      new branch to the fixed point in time on the server when the branch is actually created.
 </ul>
 <p>
 The <b>name</b> of the new branch must be unique among the child branches of the selected base branch.
 <p>
 Other ways to create branches are explained in <a href="Doc05_UsingCheckouts.html#Doc_SwitchNewBranch" title="Chapter in CDO Model Repository Documentation">Switching to a New Branch</a> and <a href="Doc01_UserInterface.html#Doc_HistoryIntegration" title="Chapter in CDO Model Repository Documentation">History Integration</a>.

<h2><a name="Doc_RenamingBranches"></a>2&nbsp;&nbsp;Renaming Branches</h2>
<p>
 Existing branches can be renamed at any point in time. The main branch of a repository can not be renamed.
 <p>
 To rename a branch select it in the <a href="Doc01_UserInterface.html#Doc_RepositoriesView" title="Chapter in CDO Model Repository Documentation">CDO Repositories View</a>, press the F2 key or open the context menu on
 that branch and select the Rename action. The following dialog will pop up: <p align="center"><img src="branch-rename.png">

 <p>
 The entered new name for the selected branch is validated to be unique among the other child branches of the
 selected branch's base branch.

<h2><a name="Doc_DeletingBranches"></a>3&nbsp;&nbsp;Deleting Branches</h2>
<p>
 Deleting branches is not yet supported.

<h2><a name="Doc_BranchShowInHistory"></a>4&nbsp;&nbsp;Showing Branches in the History View</h2>
<p>
 All branches can be shown in the <a href="Doc01_UserInterface.html#Doc_HistoryIntegration" title="Chapter in CDO Model Repository Documentation">History view</a>: <p align="center"><img src="history.png">

 <p>
 This is particularly useful if the "Link with Editor and Selection" button in the toolbar of the History view
 is not enabled and the history page does not automatically adjust to the workbench selection.

<p align="right">
<a href="Doc02_ManagingRepositories.html" title="Backward to Managing Repositories"><img src="../../images/backward.png" border="0"></a>&nbsp;<a href="Doc04_CheckingOut.html" title="Forward to Checking Out from Repositories"><img src="../../images/forward.png" border="0"></a></p>
<!-- <div class="help_breadcrumbs breadcrumbs_bottom"><a href="../Overview.html" title="CDO Model Repository Documentation">CDO Model Repository Documentation</a> > <a href="index.html" title="Category in CDO Model Repository Documentation">User's Guide</a></div> -->

<div class="copyright">Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.<br>All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html</div>
</body>
</html>

Back to the top