Accurev - 概述和常用操作/常用命令
? accurev ?    2019-01-11 16:23:16    2535    0    0
gua_l   ? accurev ?

基本概念

Workspace    - Private developer work area.
Stream          - Configuration of related elements. Code may be promoted into or inherited from streams.
Depot            - Main repository on a server for all related source code.
Snapshot       - Static (protected) stream that cannot be moved, renamed, or altered 

 

 

Stream:代码流,一个代码库的最顶层的stream (top Stream) 便是整个库的初始化stream , 基于top stream 创建 子stream , 子stream 又创建自己的子stream。并且子流创建之初继承父流的目录结构及文件内容。子流可以设置直接接收父流的修改,也可以设置只接收到截止某个时间的父流修改。子流的修改可以通过promote 操作提交到父流,非父子流之间的修改也可以通过merge 进行流动。

Workspace:基于特定流的个人工作空间,通过update 操作可以加载stream 的最新的代码,通过keep 可以把自己的修改保存到工作空间,而不影响其他人,工作空间中kept 的文件可以通过promote 操作提交到stream , 他人可通过update 获取到你的修改。

 Linux client 安装 

./AccuRev_6_0_2_LinuxClientOnly_x86_2_4.bin -i console​

机器上需要有jdk 1.6 以上版本

安装过程中除了默认enter之外,以下部分需要手动指定输入,请留意
安装路径:/opt/AccuRev
host : xx.xx.xx.xx (启动accurev 服务的服务器端的ip)
port : xxxx


CLI 基础命令

 

登录

accurev login username password​​

修改密码

accurev chpasswd​ ​

使用acgui ,linux 端的也支持GUI  ,使用acgui 与window端 界面及使用一致

acgui​


创建 workspace

accurev mkws -w <workspace> -b <stream​> -l $PATH
accurev mkws -w test_1 -b TEST -l /vob/lcf/test_1​ ​

以上例子创建出来的workspce 会以用户名为后缀 test_1_username ,可以wsp 里查看信息确认

accurev info​ ​

修改workspce 指向

##修改路径,可用于跨服务器挪动​
accurev chws -w <workspace> -l <new_dir>​
##修改based stream 
accurev chws -w <workspace> -b <new_steam>
##重命名
accurev chws -w <workspace> <new_name>

更新workspace

accurev update ​
##update 只能往后更新,如果已经更新过的文件本地删了,只能通过pop 找回 。​

暂存文件到个人workspace,文件keep 之后状态变更为 kept

accurev keep <filename> -c <comment>
accurev keep -m -c <comment>​​

提交kept 的文件到stream 

accurev promote < filename > -c <comment> -I <bug_id>​​
accurev promote -k -c <comment> -I <bug_id>​

查看文件状态

accurev stat -m
accurev stat -k​​

比较文件修改内容

## 与最近的版本比较(最近版本可以是最新一次keep 版本)
accurev diff <filename>
##与base 版本比较
accurev diff -b <filename>​

workspace中删掉或修改的文件重储:

accurev pop -R -O <filename>​
##pop 会重新获取一个最新版本的文件,最新版本指,最近一次update 或keep 的版本。​

检出某个版本的代码,-v 指定流或快照 ,-L 表示一个非wsp 的路径,用于存放检出的代码,一个点,表示全部代码(也可以换为目录或文件),-t 指定某个transation id , 不写时表示-t now ,当前时刻的提交点

accurev pop -R -O -v <stream/snapshot> -t <transation-id> -L $PATH .
accurev pop -R -O -v <stream/snapshot> -L $PATH .
accurev pop -R -O -v <stream/snapshot> -L $PATH depot/mk
accurev pop -R -O -v <stream/snapshot> -L $PATH depot/mk/version.mk

已经keep 的文件弃用:

accurev purge <filename>​​

删除workspace

accurev rm -s <workspace>​

创建snapshot

accurev mksnap -s <snapshot> -b <stream> -t now​

比较两个snapshot 之间的bug list

accurev issuediff -S <snapshot1> -s <snapshot2>​

查看提交历史 

accurev hist -t <transation> -k promote -fe

将keep后的文件关联到某个issue

accurev cpkadd -I 123456 get_remote_cm.c​

将某个文件从issue中去除关联

accurev cpkremove -I 123456 get_remote_cm.c​

查看某个issue的关联哪些文件

accurev cpkdescribe -I 123456​

查看自己的工作空间列表,加-a 查看全部人

accurev show  wspaces

根据transation号找到关联的bugID

accurev hist -t <transation#> -fx | grep issueNum​

查看某个文件中每一行是最谁(u)在哪一刻(t)的提交(transation)的版本(v) : -f(ormat) t u d v

accurev annotate -ftudv file_name

反推文件中这一某一行是由哪个bug、stream 提交的,由annotate 的-ft 得到那一行的transation ID 。根据transation号找到关联的bugID

accurev hist -t <transation#> -fx | grep issueNum​

GUI 基本使用 

update
open Workspace 之后, 点击Update。

在outgoing tab 中可以看到各个状态的文件,状态单击可选。

outgoing 中
keep
修改文件后,keep 文件到wsp,并sent to issue与bug关联
open workspace->outgoing->file->右击keep
Sent to issue文件,右击 Sent to issue

Review file
选中文件->右击merge 或ctrl + D 跳出diff 界面

Review Issue
GUI: open issue -->changes tab -->file list --> diff

Promote
promote之前必须确保编译通过
WSP->outgoing->file(kept)->promote->select issue num->ok

Purge

右击revert to backed

Merge
选中文件->右击merge 或ctrl + M 跳出merge 界面

History
acgui -->View Streams --> 右击target_stream -> show history

stream元素版本提交记录
acgui -->View Streams --> 双击target_stream -> target file -->Histroy

stream元素每行提交记录
acgui -->View Streams --> 双击target_stream -> target file --> Annotate


常见问题

1. Update keep 或update 或stat (同理acgui stat)卡死

ps -elf | grep ac |grep  <linux_username> | grep tmp
kill -9 以.tmp结尾的,最老的进程


 

2. keep卡住在某个百分比 ,25%

一般是网络问题导致的卡顿,一般等多10 几分钟就可以。
如果完全僵死,可查看是否是有任务使服务器阻塞:acgui->tools->server task 。
找出在线最长的任务,将些任务的用户session remove。
accurev remove session <user>


 

3. accurev update :File system error

Update started
Scanning entire workspace for files touched since last scan - ok
Checking 114 recently touched files for unanchored modified files -File system error:
boost::filesystem::last_write_time: No such file or directory: "/vob/ws_stream111/actmp_0"

在更新的过程中stream的base time 被修改,再执行一次更新便正常 

 


其他accurev 笔记

 

创建新流

http://blog.leanote.com/post/gua_l/Accurev-Create-stream

Jenkins 与Accurev 集成

http://blog.leanote.com/post/gua_l/jenkins-Accurev

安装报错:

http://blog.leanote.com/post/gua_l/8dbb666fd1d2

workspace 排除列表
      http://blog.leanote.com/post/gua_l/Accurev-Workspace-exclude

 


官方文档的概念参考:

File Browser 文件浏览器模式


The File Browser supports the intuitive process that developers use for creating, backing up, sharing, updating, and preserving code.
Explorer Mode  -
Displays all the files and directories that are in the current workspace or stream. For workspaces only, this can include files and directories that are not yet under AccuRev control.

Outgoing Changes Mode -
Displays only those files and directories that have been added to, changed in, or removed from the current workspace or stream. Use the Outgoing Changes mode to review your changes and share your work.

Incoming Changes Mode -
Previews the files and directories that will be changed in, added to, or removed from your workspace when you update. Update keeps your workspace current with changes in the parent stream.

Conflicts Mode -
Displays the files in the current workspace or stream whose changes conflict with another version of the same file, either in the parent stream or elsewhere in the stream hierarchy.


FILE Statuses  文件状态

AccuRev informs developers about the state of any file by displaying its status. The most common statuses are:
External - The file exists on the local computer but has not yet been placed under AccuRev control.
Kept - The file has been saved to the AccuRev server but is still private in the developer’s workspace.
Backed - The file has been promoted to the parent stream.
Modified - The version of the file in the developer’s workspace is newer than the version in the parent stream.
Overlap - The version of the file in the parent stream has been modified and the file in the developer’s workspace has also been modified.
Underlap - The version in the parent stream already contains the workspace changes, but is not the ancestor of the file. Resolve with Revert to Basis, Merge, or Purge command.
Member - The file has been promoted and is a member of a stream’s active files.
Stale - The version of the file in the parent stream has been modified and the version in the developer’s workspace has not been modified.
Stranded - Files that are not referenced by any directory in the stream of which they are a member. May indicate presence of twins - two or more elements that have the same pathname.
Twin - Two completely separate file elements in the same directory structure have the same name.
Missing - The workspace should include a version of this element, but does not. This can occur when you delete version-controlled files from the workspace using operating system commands, for example.



Pre: shell 中 循环 空格 空行 字符串转数值

Next: GitLab GEO 异地主副服务器同步--文档翻译

2535
Sign in to leave a comment.
No Leanote account? Sign up now.
0 comments
Table of content