简体   繁体   English

使用cleartool将文件添加到Linux上的sourcecontrol

[英]Adding files to sourcecontrol on linux using cleartool

I have a file that i want to add to sourcecontrol on linux using cleartool . 我有一个文件,我想使用cleartool添加到linux上的cleartool I've followed the IBM documentation for this, i've tried this: 我已经遵循了IBM文档,已经尝试过:

cleartool mkelem testScript.sh

I got an error: Can't modify directory "." 我收到一个错误:无法修改目录“。” because it is not checked out. 因为它没有签出。 I also would like to know how can i checkout/checkin files or directories and setting activities. 我也想知道如何检出/检入文件或目录以及设置活动。

You need to checkout the parent folder first. 您需要先检出父文件夹。

cd /path/to/file/
cleartool mkact newfile
cleartool checkout -c "add file" .
cleartool mkelem testScript.sh
cleartool checkin -nc

The cleartool mkact would work if you are in an UCM view. 如果您在UCM视图中,则cleartool mkact将起作用。
It will create and set a new activity, which will record the files and folder you will modify. 它将创建并设置一个新活动,该活动将记录您将要修改的文件和文件夹。

Here, the new activity newFile will record the new version of the parent folder, as well as the version 0 and 1 of the file. 在这里,新活动newFile将记录父文件夹的新版本以及该文件的版本0和1。

You should create separate questions for .. separate questions... 您应该为..单独的问题创建单独的问题...

Going back to the original - the reason why it isn't working is, as VonC has pointed out, you haven't checked out the parent of the file. 回到原始文件-不起作用的原因是,正如VonC指出的那样,您尚未签出文件的父文件。 Remember, when you run "cleartool mkelem", you are about to modify the contents of the parent directory (. in this case) by adding a new "pointer" to the element you're now creating. 记住,当你运行“cleartool mkelem”,你将要修改的父目录中的内容 (在这种情况下),加入一个新的“指针”,以你现在创建的元素。 As with everything else in clearcase, when you want to modify the contents of an element, you have to check it out first. 与其他所有情况一样,要修改元素的内容时,必须先将其检出。

One of ClearCase's greatest strength (and hardest to wrap one's head around) is the concept of an "element", IMO. ClearCase的最大优势之一(也是最难缠住的)是IMO的“要素”概念。 "Everything" behaves similarly with an element. “一切”与元素的行为类似。 Making any change to an "element" (file or directory) means you have to check it out first to make that change. 对“元素”(文件或目录)进行任何更改意味着您必须先将其签出才能进行更改。

In the case of a file, that's easy to grasp - you're just editing lines in a file. 对于文件,这很容易理解-您只是在编辑文件中的行。 For a directory, it's almost as easy - you can think of a directory as just a list of pointers to data blobs. 对于目录,这几乎一样容易-您可以将目录视为只是指向数据Blob的指针的列表。 We make the name of the blob something convenient we can remember (like foo.java or myapplication.cc or README.md). 我们使Blob的名称便于记住(例如foo.java或myapplication.cc或README.md)。 But we can also change the name of the pointer (even though it points to the same data blob) by renaming a file. 但是我们也可以通过重命名文件来更改指针的名称(即使它指向相同的数据blob)。 We can remove the pointer to the blob without impacting the blob itself by using "rmname". 我们可以使用“ rmname”删除指向blob的指针,而不会影响blob本身。 That's essentially what "rmname" does. 本质上就是“ rmname”的作用。

In ClearCases' case, the mkelem command is a little bit special - it creates the initial datablob, and adds a pointer to that datablob in the current directory (kind of does 2 things at once). 在ClearCases的情况下,mkelem命令有点特殊-它创建初始datablob,并在当前目录中添加一个指向该datablob的指针(一次执行2件事)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM