How to access accurev workspace from new machine - accurev

I have a workspace in accurev. Recently I had to change my machine and now I want to setup the accurev workspace on the new machine. When I access my workspace from GUI, it shows old system name saying the workspace is on old system and cannot be accessed from new machine.
Is there any way I can get the same workspace on the new machine? or do I need to create a new workspace on new machine?

This can be done from Accurev GUI.
Goto View -> Workspace.
It will show a list of workspaces you created earlier. Select the workspace you want to modify, right-click and choose Edit. It will open a window for you to enter the path on your new machine (browse to the location on your new machine). Follow the steps clicking next button.
Clicking Finish will update the system with the chosen location and with your new machine as the host name.

Look into "AccuRev chws":
CHWS
change the name and/or definition of a
workspace
USAGE
accurev chws -w
accurev chws -w <workspace> [ -l <new-location> ] [ -m <new-machine> ]
[ -b <new-backing-stream> ] [ -k <kind> ] [ -e <eol-type> ]
accurev chws -s ...
Look particularly at -l and -m.

Related

Move workspace to different stream in Accurev CLI

Accurev CLI documentation does not mention any command to move workspace from one stream to another without the need of creating a new workspace.
Look in manual at the "accurev chws" command
Try running this command:
accurev chws -w "workspace name" -b "name of new backing stream"
Once complete, you will need to update your workspace:
accurev update

How to download code from RTC using command line?

I need to download my source code from Rtc using command line ? Is there any command available to perform this activity?
Assuming you already have a repository workspace, then the CLI command would be scm load. Documentation is here.
To load into the current directory:
scm login -r https://server.com:9443/jazz -u user -P password -n repoNickname
scm load -r repoNickname "Workspace Name"
If the workspace name is not unique in the server, you can try the list workspace command to look for workspaces owned by you:
scm list workspaces -r repoNickname -c userName
The results will contain an alias which can be used in place of the workspace name in the load command. Alternatively you can find the UUID for your workspace by finding your workspace in the web UI and taking note of the url which will contain the workspace UUID.

iTerm2: quick download over SSH using CMD+click

iTerm2 allows you to click on a link (CMD+click) and open it quickly. However, when working over SSH, this doesn't work. Is it possible to enable this functionality, so that I can CMD+click a file, and it will automatically download into a folder on my local machine?
Thanks!
This is actually possible with Shell Integration installed. Note that Shell Integration will need to be installed on any server that you are ssh'ing into, not just on your local machine. From this link:
iTerm has recently introduced a feature called Shell Integration. Using this feature, we can upload and download files conveniently directly from iTerm 2. Drag a file into the window when pressing Option Key uploads the file to the remote ssh connection. Right-click on a file using ls command will bring up a context list containing downloading the file.
Click “iTerm2->Install Shell Integration” when sshing into the remote server.
Ensure the server has a correct FQDN as hostname and can be connected through this hostname. (You can use hostname -f to check it)
If you’re using private key authentication, then you should have id_rsa in your .ssh directory. However, you should also put id_rsa.pub in your .ssh directory to use this feature.
Sorry for the late answer, but I was just trying to do the same thing and came across your question. Thought I would post my findings once I found a solution.
I've not had much success with ⌘+Clicking to download via SCP in iTerm2 because I have a complex set of rules involving jump hosts in ~/.ssh/config.
But I have found an elegant work around: a shell function which writes to STDOUT to trigger iTerm2 into capturing the output and saving it as a file!
I keep the following snippet (Toolbelt → Snippets) which I execute to define a command download:
alias download="bash <(base64 -d <<<'IyEvYmluL2Jhc2gKaWYgWyAkIyAtbHQgMSBdOyB0aGVuCiAgZWNobyAiVXNhZ2U6ICQwIGZpbGUg
Li4uIgogIGV4aXQgMQpmaQpmb3IgZmlsZW5hbWUgaW4gIiRAIgpkbwogIGlmIFsgISAtciAiJGZp
bGVuYW1lIiBdIDsgdGhlbgogICAgZWNobyBGaWxlICRmaWxlbmFtZSBkb2VzIG5vdCBleGlzdCBv
ciBpcyBub3QgcmVhZGFibGUuCiAgICBjb250aW51ZQogIGZpCgogIGZpbGVuYW1lNjQ9JChlY2hv
IC1uICIkZmlsZW5hbWUiIHwgYmFzZTY0KQogIGZpbGVzaXplPSggJCh3YyAtYyAiJHtmaWxlbmFt
ZX0iKSApCiAgcHJpbnRmICJcMDMzXTEzMzc7RmlsZT1uYW1lPSR7ZmlsZW5hbWU2NH07c2l6ZT0k
e2ZpbGVzaXplWzBdfToiCiAgYmFzZTY0IDwgIiRmaWxlbmFtZSIKICBwcmludGYgJ1xhJwpkb25l
Cg==')"
The base64-encoded string decodes to:
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 file ..."
exit 1
fi
for filename in "$#"
do
if [ ! -r "$filename" ] ; then
echo File $filename does not exist or is not readable.
continue
fi
filename64=$(echo -n "$filename" | base64)
filesize=( $(wc -c "${filename}") )
printf "\033]1337;File=name=${filename64};size=${filesize[0]}:"
base64 < "$filename"
printf '\a'
done
Which relies on iTerm2's download protocol
Sample session showing the notifications from iTerm2:

RTC commands to extract files with an unique idenfier

Is there a way to extract files using RTC CLI by providing just a unique identifier (like workitem #?) and not provide the workspace UUID/name?
The following commands:
lscm list changesets -u username -r URL:9443/ccm -W 70
Change sets:
(1187
lscm list changes -u username -r URL:9443/ccm -j 1187
"changes": [
{
"author":
...
"path": "/unresolved/DeployFile1",
...
lscm get change 1187 /DeployFile1 -u username -r URL:9443/ccm /DeployFile1
Problem running 'get change':
Unable to determine workspace. Specify workspace. Try 'lscm help get change' for more information.
don't work as the last command is unable to determine the workspace.
We have a deployment tool that is supposed to query RTC and grab the file(s) based on user provided input (workitem # in this case). We want to keep it simple for the users and don't want to ask for workitem UUID and workspace UUID.
Any ideas? Thanks!

Forcedly update workspace in Accurev

Is there any command to update my workspace forcedly in Accurev, directly replace the local files with the backed files, and don't care about the conflict files, modified files and so on?
I really miss the cvs command cvs update -C -d
According to question, I have similar issues. Usually I just use following commands:
accurev update -9
accurev pop -O -R .
accurev update
No, you will need to run a few operations. You can create a script to force update your workspace.
Basically, you will generate a list of all the modified, kept, overlap, member files, then purge those files, then update your workspace.
Check out the stat section in the CLI manual.
What You can do is delete all the local files from the file system and then do a:
accurev pop -R <path to local workspace directory>
I had similar issue; First take a back up of existing workspace, then Delete all the files in the local work-space folder. Click update button on Accurev. All files will be re-loaded on the workspace.
If you just want to undo all changes you have done in the workspace:
accurev stat -R -m -fl . | xargs -n 1 accurev purge
You can use similar command with rm / accurev pop to force refetch from backend. You can also vary the flags, -m for modified, -k for kept, -a for all.