How does Cleacase knows that a directory is a view? - windows

I am working with a clearcase snapshot view under windows. I am trying to download the content of a file file.txt which is not loaded by my current configspec.
My snapshot view is c:\view.
The following command
cleartool get -to toto.txt someCorrectVOBdir\file.txt
works perfectly when called from c:\view, and fails when called from any non-view directory with the error
cleartool: Error: Operation "get cleartext" failed: not a ClearCase object.
Why? How can clearcase knows that the current directory is not a view directory ?

ClearCase check for a view.dat hidden file, either in the current directory or in a parent directory.
If it finds one, the current directory is part of a snapshot view.
if it doesn't find one, this isn't a ClearCase view.
If the view.dat is somehow erased and lost, it can be regenerated.

Related

Xcode Can't Commit Files to Github

I am trying to commit to my local repository but it keeps saying "The working copy “Project” failed to commit files.
warning: unable to access '/Users/me/.config/git/attributes': Permission denied"
I tried this Unable to access 'git/attributes'
It worked for a while but after about an hour of working on my project the error comes back.
I don't know if this is related but some storyboard files are randomly marked for Deletion (with the D beside their file name) when trying to commit.
Sicne that .config folder is supposed to be owned by the user, check, whenever you see again this error:
the new owner of that .config folder (to see of it is root)
the process running at that time (like a local BitBucket server running as root),
or your command history (to see if it involved a command like sudo htop)

TortoiseGit - launch repobrowser command produces "no working directory found"

From the command line I am attempting to open the repobrowser by using the following command:
TortoiseGitProc.exe /command:repobrowser
Once the command is executed a dialog displaying "No working directory found." is displayed. I have even tried pointing to where I think the repo is by the following:
TortoiseGitProc.exe /command:repobrowser /path:"http://domain.here.com/" /notempfile
This produces the same error. I have done something similar using TortoiseSVN which brings up a URL dialog box.
I have looked in the settings to see if a path may be set for temporary files, but I didn't find any. Why is this error happening and how do I correct it?
Thanks.
With (Tortoise)Git it is not possible view a remote repository in the repository browser w/o cloning it first.
TortoiseGitProc.exe /command:repobrowser w/o the /path: parameter only works if the current directory is a working tree or (bare) local repository.

How to check if a current working directory is under Perforce workspace?

I want to make build automation tool using perforce as version control system.
When I run some batch to automatically download the latest version from the repository I want to check if a current working directory is valid.
For example, when I run
p4 add file.txt
for a file not under workspace, I get this message with error code = 1
Path 'c:\file.txt' is not under client's root 'D:\workspace'.
Is there some way to explicitly check if a directory is under client's root?
Do:
p4 where ...
to see where (if anywhere) your current directory is mapped in the current client view.
Note that when you're syncing (downloading) files from the depot the current working directory isn't necessarily important. Just run p4 sync to sync your entire workspace, or use p4 sync //depot/path/... to sync an absolute depot path if that's easier than getting your script to find the correct path relative to the current client machine.

How to sync a local file with the server copy

Is there a way to sync a file from local repository with the corresponding clearcase server copy?
Can this be done by executing any command from cleartool?
Thanks in advance.
That makes sense in a snapshot view.
In such a view, you can use cleartool update:
cleartool update -force -rename aFile
That would replace any local modification by the version currently selected by the config spec of the UCM view you are in.
However, that config spec might not reflect the configuration of the stream if references.
Someone else can have changed the configuration of the stream (rebase), and your view would still reflect the old baselines.
So to be sure to get the right version (ie the one referenced by the stream), you can first reset the config spec of your view to the configuration of the stream.
cd /path/to/your/view
cleartool setcs -stream

Subversion control No Such file or directory. Can't open file

Error message :
"svn: Can't open file '/Users/username/Projects/myproject/trunk/project/.svn/text-base/filetoupdate.h.svn-base': No such file or directory"
Question:
I have an issue I've replaced a file in a project (in Xcode) with a new file (For reference and if this makes a difference, the new file has the same name as the one I deleted previously).
Now when I try to commit my changes in Xcode I get the error message detailed above and am unable to commit the changes (i.e. adding the new file).
In the file system view (in Xcode on the left hand side of the screen) the file has an R next to it (indicating Replaced in the repository).
Does anyone know how to fix it so I can commit the files?
Thanks
There is a bug or limitation in Subversion when using case-insensitive filesystems:
https://superuser.com/questions/303348/cant-checkout-in-subversion
This bug normally shows up when checking out a repository that contains two files whose names differ only in case. Of course, these cannot exist at the same time in the same directory on a case-insensitive filesystem. SVN could give a much more helpful error message, but it can't really solve the problem.
Your issue is a bit different because I assume the file filetoupdate.h (with the old case) no longer exists in your filesystem. So it's not a case conflict in the working directory. But I guess that SVN is trying to create the file in .svn/text-base with the new case, while the old one still exists, and that is failing (for the same reason).
You could try deleting the file from Subversion first, keeping the local copy (untested). The new copy must be removed from SVN control for the commit to succeed:
svn rm --keep-local --force FileToUpdate.h
And the old copy must be removed as well, to allow us to add the new copy later:
svn rm --keep-local filetoupdate.h
Commit this change:
svn commit
Now hopefully you can add the new file to version control:
svn add FileToUpdate.h
If that doesn't work, you might need to blow away the whole checkout and start again with a fresh one.
Are you on a Mac or Windows? Those have case-insensitive filesystems which causes the above problem when
a file currently exists with the same name but with different cases.
To fix , checkout out the tree on a Linux machine, then "svn rm" one of the files.
Maybe your local version has permission issues. Check if your user have the permissions to write for the .svn directories.
good luck
It looks like something got confused somewhere. To fix, I simply copied the offending files, saved them under a new name. Removed the originals from the project and the added the copied (renamed) version of the file to the project.
It seems to be that SVN doesn't like it if you add and remove a file with the same name. I tried cleaning the SVN through terminal, but it had no affect on this issue. But changing the name did work for me.

Resources