Perforce Setup Issue - perforce

I've got a Perforce server set up, and installed the P4V client. I've created a new depot and a new workspace. Per the documentation, I've mapped the workspace to the depot. So far so good.
I now have a .SQL script that was created by an external application that I wish to check in for the first time. I copied the file into my workspace and can see the file in the client's workspace tree window. Yet when I attempt to mark the file for add, I get a "file(s) not opened on this client" error. I've tried editing a changelist to include the file, but the changelist editor does not "see" the file.
I've read through the documentation (PDF files), but I just do not see what I'm missing. I've worked with other RCS software in a commercial setting, but this is my first stab at trying to set up and administer and RCS system up for personal use.

I think your problem is likely to be with the mappings. This is a reasonably common issue.
Taking your details
Workspace root: C:\Documents and Settings\wtansill\Perforce\wtansill_localhost_1666
File dir under root: C:\Documents and Settings\wtansill\Perforce\wtansill_localhost_1666\tunnel_files
View mappings:
//tunnel/... //wtansill_localhost_1666/tunnel/...
//tunnel/* //wtansill_localhost_1666/tunnel/*
With the details above, the line
//tunnel/... //wtansill_localhost_1666/tunnel/...
means that you need to place the files you wish to add into the root of your workspace plus the directory tunnel eg.
C:\Documents and Settings\wtansill\Perforce\wtansill_localhost_1666\tunnel
rather than
C:\Documents and Settings\wtansill\Perforce\wtansill_localhost_1666\tunnel_files
where you seem to have put them. A way around this is
Create the tunnel folder in the correct place (and any subfolders)
Remove the final folder from your workspace mapping so
//tunnel/... //wtansill_localhost_1666/tunnel/...
becomes
//tunnel/... //wtansill_localhost_1666/...
this would mean anything under
C:\Documents and Settings\wtansill\Perforce\wtansill_localhost_1666\tunnel_files
would be mapped to //tunnel/tunnel_files which is I think what you want.
Hope this helps.

Are you sure your filespec includes the directory you have added your file in?
Perhaps you could post your ClientSpec, and the directory in which your file is located?

Workspace root: C:\Documents and Settings\wtansill\Perforce\wtansill_localhost_1666
File dir under root: C:\Documents and Settings\wtansill\Perforce\wtansill_localhost_1666\tunnel_files
View mappings:
//tunnel/... //wtansill_localhost_1666/tunnel/...
//tunnel/* //wtansill_localhost_1666/tunnel/*
It's sort of a moot point though. The above workspace was the default set up by Perforce when I installed it. I deleted that workspace and created a new one using the P4V client, retraced my original steps, and now, lo, it works! Go figure.

Related

How to tell Gitbook where to store files locally?

I just want to create a simple gitbook on my local drive, not attached to any remote repository. I went to File->Change Library Path... and pointed to the place where I want my files to go. When I create a new book, Gitbook puts some stuff in that library path that looks right: README.md, etc. But when I change README.md in Gitbook and save the file, it doesn't save to the README.md it created when I created the book. In fact I can't even figure out where it saved my changes, even after doing a find/grep on my entire hard drive.
Edit: I need to know where it saves, so I can run the command-line gitbook to create a pdf.
Which OS are you using?
On Windows, the default directory is C:\Users\username\GitBook
I had troubles with this when I first started too.
Here is some background that may help you
There are three flavors of gitbook: The online editor (storage is on Gitbook.com or Github), the offline editor (same storage + local at C:\Users\Documents\Gitbook), and the CLI toolchain (any storage you desire).
If you talking about issuing commands, you want to install the toolchain
If you are running Windows, I can't help, but when you switch to Ubuntu :) go to toolchain.gitbook.com to see the the instructions.
Hope this helps
Yes, its weird that the changes are not immediately reflected in the physical file. I changed something and saved again, that actually made the first save visible. :D Try it once, this may work for you too.
Gitbook Editor works with git history only. So externally edited and not committed files in that folder will not be identified in the editor. However, when you save the files in gitbook editor, it creates a commit and then only it will be reflected in the physical drive location.
You can find more about the issue here: https://github.com/GitbookIO/feedback/issues/101
Currently there's no way to explicitly tell GitBook where to store files, however we use a simple workaround which allows us to use the GitBook Editor to edit a book in our own git repository but keep control of how and when we commit changes.
We have a docs directory in our project which contains the gitbook which is symlinked to the folder GitBook uses to store its own books. This directory has its own .git folder ignored from a parent directory as we don't need GitBooks commits.

In Perforce, how can I check in a file previously checked out on another machine/workspace?

I hope I'm not asking a question that's already been answered, but I can't seem to find one that fits my situation.
Scenario: Using P4V gui (2011 version), with no access to P4 command line, on Windows 7.
The setup: A user creates a workspace in Perforce from Machine A, pointing that workspace to a shared network drive, and checks out a file for editing.
Machine A then dies before the user can check in the file. The user is then assigned Machine B, for which he must create a new workspace (which is also pointed at the same shared network drive).
The problem: The problem we're having is that even though the workspace from the dead Machine A and from the new Machine B both point to the same location, Perforce considers them to be different workspaces and prevents the user from checking in/submitting the previously checked out file.
Any suggestions on how to check in this stranded file would be greatly appreciated. Thank you very much!
To be nice and clean, I'd suggest this:
Make a backup copy of the file as it exists on the shared network drive.
Connect to the depot from Workspace A (can be done from Machine B if the workspace isn't bound to Machine A).
Revert the file - this will overwrite the file on the drive with the version in the depot (aren't you glad you made a copy first?).
Switch to Workspace B.
Check out the file.
Copy the backup version over the file on the shared network drive.
Check in the file.
...and if you're not planning on using Workspace A anymore, I'd suggest deleting it.
Have you tried clearing out the Host field? For example, see 'Using the same workspace from different machines':
http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html#d0e1720
As an update from my comment response, if you need to change ownership of a changelist, the steps are documented here:
http://answers.perforce.com/articles/KB_Article/Changing-the-Owner-of-a-Pending-Changelist

How to link to the same workspace?

I have two computers: Work, and Home.
My workspace in my Work Laptop is synced in a Dropbox. That's why I could access my work at home.
But when I try to setup my Perforce at home, I don't know how to link or detect that I have an existing workspace in my Dropbox.
How?
First, I'll assume you can access your Perforce server from home, since you don't mention this in your problem statement.
Next, I'll assume you're able to use the same directory structure at home that you use at work (e.g. C:\Dropbox\projx).
When you create your client spec at work, be sure to edit out the HOST: line, since you'll be using it on two machines.
Use the same client name at home that you use at work.
If for some reason you are unable to use the same directory structure on both machines, you may have to use "p4 client" to change the ROOT: line of your client spec every time you switch between home and work.
Alternatively, you could use two different clients, and use "p4 shelve" to move files to the server when you're done for the day.
You basically just need to tell Perforce the name of your client. Usually you'll do this by adding a .p4config file in your Perforce client's root directory (or in one of its parent directories) that contains the line:
P4CLIENT=your-perforce-client-name
You might also need to add an environment variable that points to this file: P4CONFIG=.p4config.
If the local path to your client's root is different between your work and home machines, you'll also need to set AltRoots in your Perforce client specification and add the path for your home machine.

Issue while creating workspace in perforce

I am not able to create a workspace in perforce. I go to Connection --> New Workspace and then give desired workspace name and workspaceroot and then click "OK". And also it does not give any error. But when I try to access the workspace to add files in it,I am not able to access it, it gives error as "the path is not found". This means workspace has not been created in my local system. Can you please help here? I am new to perforce so please answer accordingly.
In perforce a workspace (aka client) defines the mapping of depot files to the files in your workspace (this is called the "clientview").
Most probably you made a mistake in your client view or when adding the files so that they don't fit (e.g. you can't add a file to perforce when the client does not contain a mapping for the local path it is located to a location in the depot).
In order to give better advice you need to post the content your client and the path of the files you want to add.

How do I delete a file from depot, but leave local copy in tact?

I'm trying to learn Perforce and want to delete a file from the depot(easy to do with p4 delete, p4 submit), but that deletes it from the client machine dir structure as well. I want to keep my local file in my directory intact.
The only way I can see to do this would be to move it out of the hierarchy that is under Perforce control before deleting. I was able to get my file back by syncing an earlier version.
Maybe I set up my client workspace wrong? Or am I misunderstanding a fundamental concept of source control? The client workspace is /home/user and I did it this way so I could add any file under my home directory without getting an error about the file not being under client's root.
FYI - Linux client and server running P4D/LINUX26X86/2009.1/222893 (2009/11/12)
Any advice appreciated.
Thanks.
There is a way to do this, by going behind Perforce's back. Do the following:
Rename the file you want to delete to something new
Run p4 delete on the original filename
p4 submit the change
Rename the file back to the original name
I don't believe there is any way to keep a file you are deleting under Perforce. There is good reason for this, as if the file is deleted in the depot there is no reason (from a source code control perspective) to keep a copy in the client workspace.
I suspect the issue is the way you are using Perforce.
From what you have written it seems that you are using Perforce to backup/track files in your home directory structure. So the way you are using Perforce the "master" is in your home directory and the "copies" are in the depot.
This is not the intended use of a source control system as I understand it.
The master copy of all files are actually what is in the depot. From the depot, multiple clients (views) are made for purposes such as making changes, testing, and so on. The clients are transitory and can be created and deleted as required.
To do what you want to do you may need to rethink how you are using Perforce.
some of the other commands take a parameter that lets you fake the action, but delete doesn't. You could always make a new client, do the delete in that workspace.
In the Workspace tab go to folder containing file(s) to remove from source
Right-click on that directory (or from File menu) and choose Open command window here
Note - If you open your own command prompt in the source directory you may encounter this error:
"Client 'your-client' unknown - use 'client' command to create it."
Enter command p4 delete -k <file_to_delete>
Change will be added to your P4V Helix changelist ready to check in

Resources