12.2 Change Sets

A developer changing multiple files may prefer to check them all in at the same time or not at all. If there are problems checking the files in, the developer prefers to fix the problems and then try again with the entire batch. This allows entire projects to remain consistent with versions that work together.

Many source code systems already have this concept of the change set to allow multiple files to be checked in together. Sometimes it's just a matter of committing several files together (e.g., in the Concurrent Versions System or CVS, www.cvshome.org).

DeltaV defines an activity to group changes together for checkin. An activity is a new resource type. The resource itself is very simple: It has only a few live properties defined and no body or dead properties defined. To commit a number of files together, the client makes sure that all the files are listed in the activity-checkout-set property and then checks in the activity resource. This checkin operation is illustrated in Figure 12-4.

Figure 12-4. CHECKIN of an activity commits a change set, before and after.

graphics/12fig04.jpg

When the server checks in the activity, it must check in all the checked-out resources identified by the activity or fail. After a successful checkin, the activity's activity-checkout-set property is empty.

12.2.1 Checking Out to an Activity

One way of setting up an activity with a number of checked-out files is to declare the activity when checking out each resource. The client does this by including the activity-set element and the URL of the activity in the body of a CHECKOUT request. Listing 12-1 shows how to check out one resource to the activity; the client has to do this for all the resources that will ultimately be checked in together.

In this example, the Employee.java file is checked out with apply-to-version so that it will create a working resource, and the working resource will be part of the fixbug4321 activity.

The client also has to check out and edit every file that is involved in the change. The client can do this bit by bit, adding each file to the activity as it is checked out. DeltaV also allows the client to add a resource that is already checked out, by editing the activity-set property of the checked-out resource. This causes the server to modify the activity-checkout-set of the activity to add the URL of the checked-out resource to keep consistency.

To check in a change set, the client sends a single CHECKIN request to the activity URL. The server must check in all the resources identified in the activity-checkout-set property together or fail the request and check in none of them.

Listing 12-1 CHECKOUT of a VCR to an activity.

Request:

 CHECKOUT /dev/Employee.java HTTP/1.1 Host: www.example.com Content-Type: text/xml; charset="utf-8" Content-Length: 1234 graphics/enter.gif <?xml version="1.0" encoding="utf-8" ?> <D:checkout xmlns:D="DAV:">    <D:apply-to-version/>    <D:activity-set>       <D:href>http://www.example.com/_act/fixbug4321</D:href>    </D:activity-set> </D:checkout> 

Response:

 HTTP/1.1 201 Created Location: http://www.example.com/wr/docs/index1.html graphics/enter.gif 

12.2.2 Creating Activities

A new activity can be created with a new method, MKACTIVITY. The server will advertise one or more collections where activities can be created. To get this list of activity collections, the client uses a special OPTIONS request where the body asks for the activity-collection-set. When the activity is first created this way, it will have empty properties. The user can start associating files with the activity by checking out files to the activity.

A new activity may also be created on-the-fly as a file is checked out. This is accomplished with special syntax in the CHECKOUT request to a file. The server creates the new activity with some server-selected name, and the checked-out resource is associated with the new activity.



WebDAV. Next Generation Collaborative Web Authoring
WebDAV. Next Generation Collaborative Web Authoring
ISBN: 130652083
EAN: N/A
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net