nucm-logo

NUCM-2.0 Documentation
Interface: Versioning: nc_abortchange


[Access | Versioning | Collection]

[nc_initiatechange | nc_abortchange | nc_commitchange | nc_commitchangeandreplace]

Signature

int  nc_abortchange(const char*  target,
                    const char*  t_cwd,
		    int  forced)

Functionality

Aborts change on the artifact determined by the interpretation of the parameters target and t_cwd. The contents of the artifact is restored to the contents of the version that was initiated, and the artifact can not be modified anymore. If the artifact is a collection, all members of the collection are closed. If the artifact is a collection and one or more of its members is initiated, the abort does not succeed unless the abort is forced. An abort is forced if the value of the parameter forced is 1, an abort is not forced if the value of the parameter forced is 0.

Return Values

0: everything went ok
-1: an error occurred

NdbErrno Codes

NdbOk :everything went ok
NdbUnknown :the path does not represent a NUCM artifact
NdbNotOpen :the NUCM artifact has not been opened in the workspace
NdbNotInit :the artifact is not initiated
NdbInitiated: the artifact is a collection and one or more of its members is initiated and the abort is not forced
NdbConnect :the server is down or not reachable
NdbComm :a communication error occurred
NdbProtocol :a failure occurred in the NUCM protocol
NdbNotAvail :service is not available

Example

Assuming a repository is filled with projects, and in particular contains a project "my_project" that has members "1", "2", "3", "4", and "5". Furthermore, "my_project" and its members "1", "2", "3", "4", and "5" have been opened and initiated in a workspace. The workspace looks as follows:
   /home/bigtime/andre/workspace/my_project/1
					    2
					    3
					    4
					    5
To abort change on artifact "5" and return it to its original state, the following code fragment can be used:
   #include "nc.h"
   
   nc_abortchange("my_project/5",
	          "/home/bigtime/andre/workspace",
		  1);
Artifact "5" will now have been returned to its original contents before nc_initiatechange was applied to it. To return the whole workspace to its original state, use the following code fragment:
   #include "nc.h"

   nc_abortchange("my_project",
	          "/home/bigtime/andre/workspace",
		  1);
The workspace will now have been returned to the following state:
   /home/bigtime/andre/workspace/my_project

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>