Jump to content


Adding a new P4V session

P4V

  • Please log in to reply
18 replies to this topic

#1 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 24 July 2019 - 04:56 PM

I have an existing P4V setup where the root is d:\net and in this location resides p4config.txt, which contains:

P4CLIENT=ACF_Main
P4CONFIG=p4config.txt
P4DIFF=d:\bin\wincmp.bat
P4EDITOR=C:\Program Files (x86)\CRiSP\bin.w32\crisp.exe
P4HOST=acf-q
P4PORT=perforce.assembla.com:1666
P4USER=ferrad
P4_perforce.assembla.com:1666_CHARSET=auto

This (somehow) points to my space in assembla called "ACF&Q"

I was asked to create a new space for a new project, which I did and called it "AQNET_Scripts_space".  So as not to damage my existing P4V setup, I installed P4V on a fresh laptop.  After much grief, I eventually got P4V working on that laptop, with a p4config.txt file as follows:


P4CLIENT=scripts
P4CONFIG=p4config.txt
P4DIFF=d:\bin\wincmp.bat
P4EDITOR=C:\Program Files (x86)\CRiSP\bin.w32\crisp.exe
P4HOST=ACFandQ/AQNET_Scripts_space
P4PORT=ssl:perforce-us-east.assembla.com:1667
P4USER=ferrad
P4_perforce.assembla.com:1666_CHARSET=auto

Now I am trying to add this to my main laptop.  I created a directory d:\net_scripts and copied this p4config.txt file into this location.  I followed these instructions:   https://community.pe...s/article/16265
and created a new shortcut to P4V on my desktop called "P4V Scripts".  I set the "Start In" directory to d:\net_scripts.  However when I double click on the new icon, I get a popup which says "Workspace 'scripts' does not exist", and then proceeds to bring up the connection to my previous P4V setup, which is not what I want.

So on the Workspace area, I click on New... and create a workspace called "scripts" and I open it.  Then I get a popup "Client 'scripts' can only be used from host 'ACFandQ/AQNET_Scripts_space'."  Which is odd as that is the HOST I am supposed to be using as shown in the new p4config.txt above.  Anyway I click OK, but the new workspace "scripts" does not appear in the Workspaces tab.

But annoyingly it appears in my original P4V Workspace list, created now, but with host acf-q.

I thought it might have something to do with the contents of p4config.txt being saved in the registry somewhere, as when I rename the original p4config.txt to p4config.old and then do a p4 set, it still shows me the correct p4 settings from the renamed p4config.txt file.  So I p4 set all to these to blank and renamed p4config.old back to p4config.txt, in the hopes the old P4V would pick them up from there.  But it would not start.  So I had to set them all from the commandline again.

So I am at a loss as to how to add this 2nd space using a new P4V instance.

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 25 July 2019 - 07:25 PM

This seems like a whole lot of effort to turn a trivial task into an unnecessarily confusing situation.  I can spot at least three potential headaches lurking in the way you've set up that P4CONFIG file, not even counting the fact that P4V generally does not play well with P4CONFIG files and is going to generate its own headaches if you're trusting it to obey what's in there.  What benefit does overriding P4HOST on a brand new machine get you?  Why is P4CONFIG set *in* your P4CONFIG file?  Why is the P4CHARSET set in the config file but set for a different server from what's specified in P4PORT?  Are those editor and diff tools even installed in the same places on both machines, or is the presence of this config file just going to completely break your ability to use those commands?  If the answer to all of those is "I don't know, someone else set this up for me," my advice is to delete that file completely and stop trusting that person.  :)

If you're using P4V exclusively, why not just open P4V, point it at your Perforce server, and set up a new workspace normally?

If you're using the command line, why not just follow the equivalent workflow:
p4 set P4PORT=ssl:perforce-us-east.assembla.com:1667
p4 set P4USER=ferrad
p4 client

Quote

I thought it might have something to do with the contents of p4config.txt being saved in the registry somewhere, as when I rename the original p4config.txt to p4config.old and then do a p4 set, it still shows me the correct p4 settings from the renamed p4config.txt file.  So I p4 set all to these to blank and renamed p4config.old back to p4config.txt, in the hopes the old P4V would pick them up from there.  But it would not start.  So I had to set them all from the commandline again.

Posted Image

yes, please delete p4config.txt and never look back -- the thing you want it to do is actually done by "p4 set" and the only thing the config file is doing in this instance is being confusing.  :)  Even "p4 set" isn't necessary if you're using P4V because you can just enter the settings directly in there (where it stores them in its own settings file)!

Config files are very useful if you have multiple workspaces on a machine and you're working from the command line because they let you associate different configurations with different working directories.  I would go so far as to say they're essential for any power user.  But if you have only one workspace on this laptop, you don't need multiple configurations, and if you're using P4V, there's no such thing as a "working directory", so having a config file is not only pointless but doubly pointless here, and it seems to be the cause of a whole lot of wheel-spinning.  Just nuke it.

#3 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 30 July 2019 - 04:23 PM

Thanks for the update, been away for a few days.  Right, trying all this again from your simpler approach.  I am the only one doing this, so I am to blame!  I was just following some guidelines on some other perforce forum post.

I fired up a command window, went into d:\net and executed:

Quote

p4 set P4PORT=ssl:perforce-us-east.assembla.com:1667
p4 set P4USER=ferrad
p4 client

well the last command just brings up my editor, which I then exit, and then type p4v, and voila my original p4v session came up.

Now I tried to do the same with my new p4v session.  I fired up a new cmd window, went into d:\net_scripts.  But I realized if I typed the same as above it would just bring up the same as above, ie. the original p4v session.  So I created a  BAT file containing

Quote

p4 set P4PORT=ssl:perforce-us-east.assembla.com:1667
p4 set P4USER=ferrad
p4 client AQNET_scripts

ie. I added the new client name, but this this brings up my editor again

However when running it, I just get:
Perforce client error:
        Connect to server failed; check $P4PORT.
        connect: 18.188.76.158:1667: WSAETIMEDOUT

I added P4HOST=ACFandQ/AQNET_Scripts_space to this BAT file, but still get the same error.

So I tried putting all the p4 sets into 2 BAT files:

Quote

D:\net>type perf1.bat
p4 set P4CLIENT=ACF_Main
p4 set P4DIFF=d:\bin\wincmp.bat
p4 set "P4EDITOR=C:\Program Files (x86)\CRiSP\bin.w32\crisp.exe"
p4 set P4HOST=acf-q
p4 set P4PORT=perforce.assembla.com:1666
p4 set P4USER=ferrad
p4 set P4_perforce.assembla.com:1666_CHARSET=auto
p4 client ACF_Main
p4v

(which works)
and:

Quote

D:\net_scripts>type perf2.bat
p4 set P4CLIENT=AQNET_scripts
p4 set P4DIFF=d:\bin\wincmp.bat
p4 set "P4EDITOR=C:\Program Files (x86)\CRiSP\bin.w32\crisp.exe"
p4 set P4HOST=ACFandQ/AQNET_Scripts_space
p4 set P4PORT=ssl:perforce-us-east.assembla.com:1667
p4 set P4USER=ferrad
p4 set P4_perforce.assembla.com:1666_CHARSET=auto
p4 client AQNET_scripts
p4v

(which doesn't work)

Clutching at straws now...

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 30 July 2019 - 04:47 PM

View Postacferrad, on 30 July 2019 - 04:23 PM, said:

I fired up a command window, went into d:\net and executed:

well the last command just brings up my editor, which I then exit, and then type p4v, and voila my original p4v session came up.

Now I tried to do the same with my new p4v session.  I fired up a new cmd window, went into d:\net_scripts.  But I realized if I typed the same as above it would just bring up the same as above, ie. the original p4v session.  So I created a  BAT file containing

nooooooooooooo

I had to literally stop reading here out of sympathetic pain.  :)  P4V is not a command line tool.  You do not interact with it by writing batch scripts.  All of the stuff you're doing at the command line is pointless as far as P4V's concerned.  Just click where it says "workspaces" and then select the workspace you created for this machine.  (You did that when you ran "p4 client" and exited your editor.)  That's all you need to do.  

You never even need to touch a command line if your goal is to use P4V for everything; you could have just clicked "new workspace" in P4V.  I probably should have told you to just do that, but I still wasn't clear on whether you actually wanted to use the command line client for anything Perforce-related.  If you wanted to use the command line client (p4), you were already set to go as soon as you ran "p4 client" to create your workspace.  Everything after that point was just wheel-spinning at best.  I'm sorry you've been wasting so much time on this, setting up a new workspace really shouldn't involve this much anguish.  :(

#5 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 30 July 2019 - 07:11 PM

ok I think there is a misunderstanding of my problem.  We have been using P4V successfully for one space containing one repository for 3 years.  I launch P4V from the desktop
and all works well.

Now I have been asked to create a new space for a second project (scripts), separate from the above.  So this is what we envisage we need to do:

ACFandQ.assembla.com
     |
    +---- space ACF&Q
     |               |
     |               +  repository P4
     |
     |---- space AQNET_Scripts_space
                     |
                     + repository AQNET_Scripts_repo

So now I need to start a 2nd P4V session to access this now space.  If I simply double click on P4V it just brings up a copy of the 1st one above.  So I go into Open Connection and change the workspace from ACF_Main to AQNET_scripts.  However when I click OK, I get an error "Client 'AQNET_scripts' can only be used from host 'ACFandQ/AQNET_Scripts_space'."

So clearly this new P4V session has to be told about the HOST somehow.  I thought that was through the p4 set and/or p4config.txt file.  But according to your replies clearly not.

So how do I bring up another P4V session to connect to my 2nd space?

#6 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 30 July 2019 - 07:50 PM

1) Do not share workspaces between different client machines.  This will cause you pain.
2) Delete all those P4CONFIG files and batch scripts.  They are already causing you pain.
3) Open P4V, "New Workspace".
4) Indicate in the workspace spec what files you're working on.  If you're using streams, put the correct stream in the "Stream" field; if you're not using streams, make sure your View maps the correct depot path.
5) Click "OK" or whatever to finish creating the workspace.  All done!  Use P4V normally.

(edit) Alternate solution: in place of 3 and 4, find your existing workspace, right-click, and "create new workspace using X as template" or whatever the verbiage is.  This will make a new workspace that automatically copies its Stream and/or View from the selected workspace.

Additional note: your use of the term "space" is sufficiently confusing that I'm not completely sure that I'm actually answering the right question.  So far I've been assuming you mean "workspace".  In your original post you talked about needing to set up a new laptop, which would imply a new workspace.  But your latest post makes it sound like you're just adding a new folder to the depot (which does not require the use of a new laptop, a new installation of P4V, a new P4V "session", OR a new workspace).

What is a "space"?

#7 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 30 July 2019 - 11:12 PM

Re-reading your post again it seems like a "space" could be a depot, or a folder, or a stream, or an entire server instance -- I want to just give you the set of steps to do the thing you're trying to do (I'm pretty sure now that this is a basic task that you could do within your original workspace) but I don't want to add to the chaos by giving you the steps to, say, create a folder in a depot when you're actually trying to create a new depot.  

If you're not sure which of those terms applies, a screenshot of whatever the thing is you call a "space" (in your original P4V "session" where the "space" is visible) would go a long way toward resolving my confusion.  :)

#8 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 31 July 2019 - 02:58 PM

Thanks, I wish I new how to attach an image - when I click on Image above, it asks for a URL, seems I can't just copy/paste in here. So looks like I'll have to try explain in words.

We are using Assembla to host our project.  We have been for 3 years.  It was set up as a "Repository" in a "Space" (their terms).  Now we need to add a new user with his new project.  He can't have access to our project, but we can have access to his.  It is our understanding that we have to create another "Space" to hold his new Repository.  This appears to be the solution where user access can be limited as above.  So we did this in Assembla.  We now have a second "Space" containing a nee "Repository"

As a test, I set up perforce on a new laptop and managed to connect to this Space (or whatever it is called) and can use Perforce on the new project.  All's good so far.  But that's just a throwaway session as I need to access the new Space from my laptop not this test laptop

The problem comes now when I want to access this new Space on my laptop which I have using for 3 years, happily connected to the original "Space".  I need to access both of these "Spaces" in 2 different P4V instances on my laptop.

I have deleted all my p4config.txt files and BAT files, so I am back to square 1 where I have the original P4V working fine on my laptop, but have no idea how to get the 2nd one set up and working without interfering with the first.  Maybe you can explain what to do from here.

#9 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 31 July 2019 - 03:19 PM

Okay, got it -- sounds like a "space" is a server instance!

In P4V, go to Connection > Open.Connection... and enter the server address of the second server, along with your user name.  (Same as you were trying to do with the config files, but just tell it to P4V in that dialog.)  It should look like this:

Posted Image

If you want, you can set up a new workspace now by clicking "New" next to where it says "Workspace".  You'll need to do this at some point to be able to sync files down to your laptop and work on them, but you can also just browse the depot via P4V without a workspace.

P4V remembers what servers you've connected to, so once you've done that once, you can just pick from the "recent connections" list rather than having to type it in each time.  (This is the P4V equivalent of having different command line config files for each local root directory.)

Posted Image

It's not any more complicated than navigating to a web page in a browser.  :)

#10 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 31 July 2019 - 03:29 PM

How do I embed a screenshot like you did above?

#11 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 31 July 2019 - 03:33 PM

Posted Image

#12 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 31 July 2019 - 03:38 PM

That just brings up a window titled "Image Properties" with one text box called URL, and OK / Cancel.  I have no idea what to put into that box.

#13 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 31 July 2019 - 03:45 PM

I opened a new P4V and went into Connection -> Open Connection.
I chose the one 2nd in the list.
I clicked OK, it went away for 30 secs, and came back saying:

Connect to server failed; check $P4PORT.
connect: 18.188.76.158:1667: WSAETIMEDOUT

Posted Image

#14 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 31 July 2019 - 03:59 PM

In your original post it looked like you were trying to connect to a server at ssl:perforce-us-east.assembla.com:1667.  What happens if you put that into the "Server" field?

#15 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 31 July 2019 - 04:17 PM

Yes, that is what is in the Server box.  Wish I could paste an image!

#16 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 31 July 2019 - 04:31 PM

So I googled "Assembla Perforce hosting" to try to figure out how it works and what you're supposed to be setting your P4PORT to and found this article: https://articles.ass...perforce-issues

which explains why you were doing the weird stuff with P4HOST.  It also strongly implies that Assembla does not support multiple "spaces" with P4V on a single client machine, because there's no way to swap P4HOST values in P4V.  P4HOST refers to the client host (NOT the server host) and is supposed to be unique per client machine.  They might have some compelling technical reason for putting server configuration into a client variable but my kneejerk assessment starts with "gross" and ends with "ompetence".  They could not have made this more difficult to use if they had tried.  

You can make this work with a single P4V connection by setting P4HOST globally, but as soon as you try to add a second one, it's all going to fall apart (as you've observed, and as I'm now FINALLY understanding is inherent to Assembla's server architecture; not having that context the configurations you were trying made no sense whatsoever because they're so at odds with a normal Perforce setup).

How comfortable are you with just not using P4V and using the command line instead?  I have to imagine the Assembla folks use the command line exclusively or this bizarre P4HOST scheme would never have made it out of alpha.

#17 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 31 July 2019 - 04:48 PM

P4V's connection settings XML file (its equivalent of P4's config files; you can find this in your .p4qt folder) doesn't even have a place to put the client host:

<?xml version="1.0" encoding="UTF-8"?>
<!--perforce-xml-version=1.0-->
<ConnectionMapList varName="connectionmaplist">
<ConnectionMap>
<Name>0002</Name>
<User>sam_stafford</User>
<ServerAddress>wayfarer-p4d:1666</ServerAddress>
<P4Port>public.perforce.com:1666</P4Port>
</ConnectionMap>
<ConnectionMap>
<Name>0001</Name>
<User>Samwise</User>
<ServerAddress>COMPY386:1777</ServerAddress>
<P4Port>1777</P4Port>
</ConnectionMap>
</ConnectionMapList>

I experimented with hacking it in there using names like "P4Host" and "Host" and "ClientHost" but couldn't get P4V to pick it up.  It's only ever going to get it from the environment you launch the app in (which is then going to be shared by all P4V windows, making it impossible to use multiple Assembla instances from one P4V instance).

That aside, it sounds like there's a more fundamental problem where you can't even connect to the P4PORT they've given you.  (I assume this is some kind of broker that then redirects you to your actual server instance by sniffing your P4HOST value -- which, again, is just baffling to me as something that anyone would implement.  I have to figure it was some kind of desperate hack because they couldn't get it to work by just having a name entry in the P4PORT field, but if I were going to do a desperate hack like that I'd have embedded it as a substring of P4USER since that's something you can at least set from the GUI.)  Maybe their server is down?

#18 acferrad

acferrad

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 31 July 2019 - 06:19 PM

I got it to work but with only one P4V session at a time.  When I want to swap to the other, I close down P4V, reset P4HOST and then start P4V up again.  Yes Assembla is really confusing.  I used to use Perforce at a previous company quite seemlessly with a internal server, but our company is too small, so we have to rely on external servers, and Assembla was the first one I found.

#19 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 928 posts

Posted 31 July 2019 - 06:45 PM

My guess is that it's just not designed for use with more than one server instance, and you're supposed to put everything onto a single server instance (i.e. put your projects in different depots within the same repository).





Also tagged with one or more of these keywords: P4V

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users