Jump to content

Adding Files from the Command Line


carpediemevive

Recommended Posts

I'm trying to do a batch update of our plastic repositories from our old CVS system. I don't care about CVS history or anything; it's really a very simple exercise. Here's my methodology:

  • Checkout the repository from CVS
  • Get rid of all the CVS control files
  • Create a workspace for the corresponding repository in Plastic
  • Do some fancy work here to get the workspace in the position I want it (this all works)
  • Remove every file from the plastic workspace
  • Copy all of the files from the CVS checkout folder into the Plastic workspace
  • Add all files and commit them all.

It's rudimentary I know, but it's all I really need to do. When I get to the last step, I am trying to add the files.

cm add -R .\*

The above command is what I'm using to add files. When I use it, I get an error telling me one of the files already exists. I'm executing this in the root of the workspace. Here's my log file:

2012-11-02 12:56:35,786 INFO  4268 cm - STARTING CLIENT
2012-11-02 12:56:36,052 DEBUG 4268 ClientConfig - Time loading client.conf (C:\Documents and Settings\adh\Local Settings\Application Data\plastic4\client.conf) 265 ms
2012-11-02 12:56:36,505 INFO  4268 Performance - Add - Exclude Paths: 62 ms
2012-11-02 12:56:36,677 INFO  4268 Performance - Add - Check Items Exist: 172 ms
2012-11-02 12:56:36,708 INFO  4268 Performance - Add - Build Add Info: 32 ms
2012-11-02 12:56:36,724 DEBUG 4268 WorkspaceLockHandler - Create lock for d for workspace c:\cvs_reimport\plastic_workspaces\plastic_update_AlrisService.Net.It locks the workspace.
2012-11-02 12:56:36,724 DEBUG 4268 WorkspaceLock - Workspace c:\cvs_reimport\plastic_workspaces\plastic_update_AlrisService.Net locked
2012-11-02 12:56:36,724 DEBUG 4268 WorkspaceTree - Initialize - Going to load tree
2012-11-02 12:56:36,724 DEBUG 4268 WorkspaceTree - BuildTree for workspace 76d42a3a-203c-42d1-869b-9475c8d94fa0
2012-11-02 12:56:36,739 DEBUG 4268 WorkspaceDataStore - GetWorkspaceContent 16 ms
2012-11-02 12:56:36,739 DEBUG 4268 WorkspaceTree - BuildTree 16 ms. WkId 76d42a3a-203c-42d1-869b-9475c8d94fa0
2012-11-02 12:56:36,739 DEBUG 4268 WorkspaceTree - Initialize - tree timestamp is 634874573417270276/20007
2012-11-02 12:56:36,739 DEBUG 4268 WorkspaceLockHandler - Delete lock for d for workspace c:\cvs_reimport\plastic_workspaces\plastic_update_AlrisService.Net.It unlocks the workspace.
2012-11-02 12:56:36,739 DEBUG 4268 WorkspaceLock - Workspace c:\cvs_reimport\plastic_workspaces\plastic_update_AlrisService.Net unlocked
2012-11-02 12:56:36,739 DEBUG 4268 WorkspaceTree - Clean() WkId 76d42a3a-203c-42d1-869b-9475c8d94fa0
2012-11-02 12:56:36,755 ERROR 4268 cm - Plastic client version: 4.1.10.361
2012-11-02 12:56:36,755 ERROR 4268 cm - The item /ALRIS_SERVICE.INI already exists!.
2012-11-02 12:56:36,755 DEBUG 4268 cm - The item /ALRIS_SERVICE.INI already exists!.   at aiy.a(List`1 A_0)
  at abl.a(String[] A_0, AddOptions A_1, SEID A_2, IList& A_3)
  at Codice.Client.BaseCommands.BaseCommandsImpl.a(String[] A_0, AddOptions A_1, SEID A_2, String A_3, String A_4, IList& A_5)
  at aww.a(b A_0)
  at w1.c(String[] A_0)

the command cm fc -R returns nothing.

the command cm fco returns nothing.

the command cm fp -R returns one folder, which is what I want to actually have added.

In this topic: () there's a lot of talk about whether the file exists or not. The file it complains about is already in the repository, I just want to add all private files into the repository.

I am able to do this in the GUI by right-clicking on the root directory and clicking on ("Add directory tree to source control").

Thinking that maybe I need to change the path from .\* to just ., I tried that and then it complains that the root is already in control.

How can I, from the command line, add all private files to the repository?

Link to comment
Share on other sites

Hi carpediemevive,

make sure you are creating a new repository and also a new workspace working with the brand new repository.

Here you have a pseudo algorithm:

cm mkrep projectA

mkdir prjA

cm mkwk wkPrjA --selector=pathToSelectorFile.txt

cm add * -R

cm ci

the pathToSelectorFile.txt is a file with the following content:

repository "prjA"
 path "/"
   smartbranch "/main"  

You have to change the repository name, to work with the recently created.

Link to comment
Share on other sites

Ahh, part of my problem might have been that I was working with an existing repository. Basically I wanted to take everything in the repository that was added and private (not ignored) and add it. I worked around it by constructing the list of such files myself. Having a shortcut would be nice, but not a deal breaker.

Link to comment
Share on other sites

My command-line-fu is weak! I never thought about just piping findprivate into add. Instead I used findprivate to get the list and then took that return and passed it into add with a little reformatting to make sure it looked ago. Piping would have been much more straightforward, easy to read, and easy to write. I will keep this in mind for the future.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...