nucm-logo

NUCM-2.0 Documentation
Interface: Distribution: nc_move


[Removal | Distribution | Miscellaneous]

[nc_move | nc_getlocation | nc_setmyserver]

Signature

int  nc_move(const char*  path,
	     const char*  p_cwd,
	     const t_server*  server)

Functionality

Physically moves the history of the NUCM artifact determined by the interpretation of the parameters path and p_cwd to the NUCM server addressed by the parameter server. The move has no other effect than that the history of the artifact is moved to a different physical location, all operations on the artifact continue to operate as normal.

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
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" and "2" have been opened in a workspace. The workspace looks as follows:
   /home/bigtime/andre/workspace/my_project/1
					    2
A new repository has been created, with an access server running on machine "anchor.cs.colorado.edu" that listens to default port "1234", and that the project and its members "2", "3", and "4" have to be moved into that repository. The following code fragment can be used to do so:
   #include "nc.h"

   t_server  server;

   strcpy(server.host, "anchor.cs.colorado.edu");
   sprintf(server.port, "%d", NUCM_PORT);
   nc_move("//serl.cs.colorado.edu/nucm_root/my_project/3",
	   "",
	   &server);
   nc_move("//serl.cs.colorado.edu/nucm_root/my_project/4",
	   "",
	   &server);
   nc_move("my_project",
	   "/home/bigtime/andre/workspace"
	   &server);
   nc_move("2",
	   "/home/bigtime/andre/workspace/my_project",
	   &server);
Note that port "1234" is the default port a NUCM access server listens to, so we use the NUCM_PORT macro to set it in the variable server. In addition, the workspace has not changed, and artifacts can still be accessed and versioned in the same way. The only thing that has changed is the physical location of the artifacts that have been moved.

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>