Perforce Ghost Depots - server

I administer a Perforce p4d server at a faculty at a university.
Recently I accidentally created 2 Depots and 2 Groups (using a python script) with names including a BOM in front of the name. The character set of the server is utf8 (without BOM).
Both Depots show up in P4V and P4Admin, but do not properly work. The groups do show up in P4Admin but as soon as I try to select them they disappear from the list.
I have tried a lot, but was not able to get rid of them. Could someone provide me a way to delete them?
When I try to delete them I first get the Message "//WS18_EL_VRClass/... - must refer to client '_____CLIENT_UNSET_____'."
and then
"The depot contains files that are marked for add or edit.
These files must be reverted before deleting the depot."
I killed all workspaces referring to the Depots.
Any ideas?
Martin

Unix?
Assuming you have the helix server privs to delete the groups and depost, first open a terminal window. (In P4V, pick a folder on the workspace tab and right/context click to "open terminal window". This will setup your P4 env variables.)
Then use "p4 group -d" and "p4 depot -d" to delete.
For example, assuming your group is "BOMoops", run:
p4 group -d `printf "\\357\\273\\277"`oops

Related

Perforce: Prevent keywords from being expanded when syncing files out of the depot?

I have a situation where I'd like to diff two branches in Perforce. Normally I'd use diff2 to do a server-side diff but in this case the files on the branches are so large that the diff2 call ends up filling up /tmp on my server trying to diff them and the diff fails.
I can't bring down my server to rectify this so I'm looking at checking out the the content to disk and using diff on the command line to inspect and compare the content.
The trouble is: most of the files have RCS keywords in them that are being expanded.
I know can remove keyword expansion from a file by opening the files for edit and removing the -k attribute from the files in the process, but that seems a bit brute force. I was hoping I could just tell the p4 sync command not to expand the keywords on checkout. I can't seem to find a way to do this? Is it possible?
As a possible alternative solution, does anyone know if you can tell p4 diff2 which directory to use for temporary space when you call it? If I could tell it to use abundant NAS space instead of /tmp on the Perforce server I might be able to make it work.
I'm using 2010.x version of Perforce if that changes the answer in any way.
There's no way I know of to disable keyword expansion on sync. Here's what I would try:
1) Create a branch spec between the two sets of files
2) Run "p4 files //path/to/files/... | cut -d '#' -f 1 > tmp"
Path to files above should be the right hand side of the branch spec you created
3) p4 -x tmp diff2 -b
This tells p4 to iterate over the lines of text in 'tmp' and treat them as arguments to the command. I think /tmp on your server will get cleared in-between each file this way, preventing it from filling up.
I unfortunately don't have files large enough to test that it works, so this is entirely theoretical.
To change the temp directory that p4d uses just TEMP or TMP to a different path and restart p4d. If you're on Windows make sure to call 'p4 set -S perforce TMP=' to set variable for the Perforce service; without the -S perforce you'll just set it for the current user.

Delete a Perforce client workspace with pending files when the workspace has already been removed from disk?

How do I delete a workspace that has pending files when that workspace has already been removed from disk?
Caveats:
p4 command line only; not p4v gui
regular user access; no admin access
Scenario:
create a workspace named user_workspace on the disk in the ~/my_workspace directory
p4 edit files in workspace on the default pending changelist
remove workspace by hand (rm -rf ~/my_workspace)
workspace still exists on server with pending files
Solutions that don't work:
1: Delete workspace
Doesn't work because the workspace has files opened.
p4 client -d user_workspace
Client 'user_workspace' has files opened; use -f to force delete.
2: Delete workspace with force
Doesn't work because not admin.
p4 client -d -f user_workspace
You don't have permission for this operation.
3: Delete the pending changelist; then delete workspace (try 1)
p4 changes -c user_workspace -s pending
Only lists pending numbered changelists, does not handle the default pending changelist.
p4 -c user_workspace -d changelist_number
Not possible because there is no changelist number for the pending changelist.
4: Delete the pending changelist; then delete workspace (try 2)
Trying to do a p4 revert on a directory that does not exist anymore gives a strange error.
p4 revert ~/my_workspace
/home/user/my_workspace - must refer to client 'user_workspace'.
p4 -c user_workspace revert ~/my_workspace
/home/user/my_workspace - must refer to client 'user_workspace'.
setenv P4CLIENT user_workspace; p4 -c user_workspace revert ~/my_workspace
/home/user/my_workspace - must refer to client 'user_workspace'.
1. Revert the pending changelist
Have to use Perforce depot notation instead of local directory notation because the local directory does not exist anymore.
p4 -c user_workspace revert -k //...
//blah/blah/blah/file#rev - was edit, reverted
2. Delete the client workspace
p4 client -d user_workspace
Client user_workspace deleted.
this will give you the pending changes on the client
p4 changes -c user_workspace
this will delete the pending change list of your choice
p4 change -d <change list number>
after that, you can delete the client using
p4 client -d user_workspace
The command line did not work for me. It kept reporting "over license quota" for any commands. I probably have something configured wrong related to that. This would mean I would have to first correct that problem and then use the above solution. However, I found another way to fix this issue using the p4v client.
The junk workspaces were old workspaces from my previous computer. Those without any files checked out I was able to right-click delete in the workspaces tab view. Those workspaces with files left checked out I was not able to remove as other are experiencing. To removes these I had to take a few extra steps.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Alternatively: Try these four step using only the p4v client *
Edit the workspace and just blank out the host field of the old workspace. In another thread I read this allows editing from any computer.
Switch to the workspace
Revert the files in the WORKSPACE view; there was no need to sync the files to my local machine
Delete the workspace after switching back to the workspaces tab.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I hope this helps someone.
Wrote this script called p4-delete-client for deleting a p4 client (which has changelists & other problems).
It has the following features:
automatically deletes changelists (reverts pending & deletes shelved)
fixes hostname (if differs from the one the client was created on)
unlocks the client if locked
deletes the client
deletes associated files (can be configured not to from arguments)
Note that the script relies on other scripts in the repo.
The rm -rf command only deleted files on your system, the workspace still exists in perforce. If you want to delete it, you have to revert the files first.
p4 revert ~/my_workspace
p4 client -d user_workspace

TFS command line to get list of files checked in yesterday

I'm looking for a simple way to get a list of files that were checked in on a certain day. Is there a command line I can use? I don't want changesets just the file names.
A bit late, but for others asking the same question.
Open a Visual Studio Command Prompt (2010) and use the command:
tf history "local path" /version:D2011-03-29 /recursive /noprompt
Replace the date with the date you wan't information about and localpath to the local folder you bound to, you WILL get the changeset number, but also all items changes. It's also possible to use a collection and remote path instead of local path.
Naturally you can discard noprompt and login and put in that information in a prompt.
More information about the TFS 2010 commandline: http://msdn.microsoft.com/en-us/library/yxtbh4yh.aspx
Use tf command line. It may do what ever you want.

Setting SVN username (Author Name in Eclipse) when using svn+ssh

When I commit changes in Eclipse, svn records my author name as the one that I entered the first time I committed changes in Eclipse (Alok). By author name, I mean the name that shows up when you run "svn log" or "svn blame".
However, when I commit changes from the command line, the Author Name is set to the username that I use to ssh to the repository (svnadmin). Is there a way to set the equivalent of Author Name/svn username independently of the ssh username from the command line when using svn+ssh? I have tried
svn --username Alok ci
but the username in this case is ignored, and the change is attributed to svnadmin.
It is by design that you cannot change the username for svn+ssh. If you could, you would be able to fake somebody else as the committer - when the SSH key would normally clearly identify yourself as the committer.
So if you want different committer names to show up with svn+ssh, you need to change something on the server:
Create separate remote users, and put your key into the authorized_keys file for the user you want to appear as committer. Alternatively,
Put command= lines into the authorized_keys file of the svnadmin user. The command should read /usr/bin/svnserve -t --tunnel-user Alok; optionally also with a --root option.
One workaround is to first enable editing of revision tags by putting a shell script like the following in hooks/pre-revprop-change
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
if [ "$PROPNAME" = "svn:log" ]; then exit 0; fi
if [ "$PROPNAME" = "svn:author" ]; then exit 0; fi
exit 1
Then, after the commit you can change the svn:author with
svn propset --revprop -r1234 svn:author Alok
This does not explain how eclipse is able to set svn:author at commit time without having a pre-revprop-change hook. This solution is a little unsatisfying because it allows any user to change the svn:author of any commit, it would be nice to know what eclipse is actually doing.

What is the command line syntax to delete files in Perforce?

I am creating some build scripts that interact with Perforce and I would like to mark for delete a few files. What exactly is the P4 syntax using the command line?
p4 delete filename
(output of p4 help delete)
delete -- Open an existing file to delete it from the depot
p4 delete [ -c changelist# ] [ -n ] file ...
Opens a file that currently exists in the depot for deletion.
If the file is present on the client it is removed. If a pending
changelist number is given with the -c flag the opened file is
associated with that changelist, otherwise it is associated with
the 'default' pending changelist.
Files that are deleted generally do not appear on the have list.
The -n flag displays what would be opened for delete without actually
changing any files or metadata.
Teach a man to fish:
p4 help - gets you general command
syntax
p4 help commands - lists the
commands
p4 help <command name> -
provides detailed help for a specific
command
http://www.perforce.com/perforce/doc.062/manuals/boilerplates/quickstart.html
Deleting files
To delete files from both the Perforce server and your workspace, issue the p4 delete command. For example:
p4 delete demo.txt readme.txt
The specified files are removed from your workspace and marked for deletion from the server. If you decide you don't want to delete the files after all, issue the p4 revert command. When you revert files opened for delete, Perforce restores them to your workspace.
Admitted - it takes a (small) number of steps to find the (excellent!) Perforce user guide online in the version that matches your installation and get to the chapter with the information you need.
Whenever I find myself in need of anything about the p4 command line client, I rely on the help Perforce have built into it. Accessing it could not be easier:
on the command line, enter p4
This gets you to the information Michael Burr has shown in his answer (and some more).
If you do not get a help screen right away, something is wrong with our client configuration, e.g. P4PORT is not set properly. You obviously need to fix that first.