[p4] what's the best way to determine the current client workspace?
Jay Glanville
Jay.Glanville at naturalconvergence.com
Thu Jun 28 04:44:46 PDT 2007
The general purpose of the script? It's a loadbuild script. I'm
contemplating using the change list number as a "build identifier", or
serial number.
The sequence of events would be something like this:
* loadbuilder creates an automatic label based on a change list
number
* they sync to that label (or change list number) and only that
label. That is: "sync #0", remove any remaining files from HD, "sync
@build_label".
* they run the loadbuild scripts
The loadbuild script does the following:
* generates a build id based on the latest change list number for
the given branch (it's in this area that I was asking for help)
* performs the loadbuild
* embeds the build id into any deployables (comment area for zips,
manifest for jars, etc)
The build id / number is most important in formal loadbuild scenarios,
where the loadbuilder focuses on getting everything. They don't do
things like: sync file x to 10, sync file y to 20.
So, I think I've mitigated your boundary case. Does this logic make
sense to you? or does anyone see a hole in my plans?
Thanks to all.
JDG
---
Jay Dickon Glanville
-----Original Message-----
From: Jeff A. Bowles [mailto:jeff.a.bowles at gmail.com]
Sent: June 27, 2007 11:37 PM
To: Jay Glanville
Cc: Perforce Users
Subject: Re: [p4] what's the best way to determine the current client
workspace?
Perhaps:
p4 changes -m 1 //...#have
might be what you want?
Still, I wonder about the boundary case: when someone did a 'sync'
on part of, but not all of, the files mapped to the works. (Then, there
might be content that a single "path at changelist" might not describe.)
What's the script gonna do, big-picture-wise? The
boundary case I cite might not be a big deal, and might yet be one.
So it's worth asking what you're trying to do...
-Jeff Bowles
On Jun 27, 2007, at 12:00 PM, Jay Glanville wrote:
I want to write a script that calls a perforce command where one of the
arguments is the name of the current workspace. The desired output of
the command is the latest change list number on the current hard drive.
In other words, I want to execute the following command:
p4 changes -m 1 \
//branch_name/...@[current_workspace] | \
sed 's/Change \([0-9]*\).*/\1/'
Where [current_workspace] is the name of the current workspace. My
question is this: what is the best way to determine what is the current
workspace? My original thought was to parse the client spec, something
like this:
p4 client -o | \
sed 's/^Client: *\([a-zA-Z_0-9]*\).*/\1/'
(I know that this sed won't actually work, but you get the idea).
So, is this the best way? Is there a better way? Is there a direct way
to do this (by that, I mean simply ask p4 directly 'what is the current
workspace')?
Thanks
JDG
---
Jay Dickon Glanville
_______________________________________________
perforce-user mailing list - perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
More information about the perforce-user
mailing list