<html>
<head>
<title>The Branching Papers -- Perforce FAQs</title>
<head>
<body bgcolor=#ffffff>
<font size=-2><b><a href="branching.html#br06">[INDEX]</a></b></font>
<p>
<b>
Is there a way to see what a branch view looked like in the past?
Can this information be determined from "filelog" output?
</b>
<blockquote>
Unfortunately, <b>p4 filelog</b> does not give you a synopsis; it gives
you detail. So, to regenerate a branch view, you'd have to write
a script that does quite a bit of analysis of the
<b>p4 filelog</b> output. In fact, since
<b>p4 filelog</b> reports the entire history of files, a
very clever script
could reproduce a branch view as it looked at any point in time.
But I have to admit
I'd rather look in old checkpoints to find a lost branch view than
write this clever script...
<p>
The branch view is one of several data entities that are stored in
a Perforce server's metadata but not versioned. Other such entities
include clients, users, depots, labels, and jobs. These are fairly
static entities, and the original Perforce philosophy was
(1) versioning these entities would add more overhead than value,
(2) users can store and version specs for these entities at will,
and
(3) these entities can always be restored from checkpoints.
<p>
Nevertheless, customers have requested some way of versioning these
entities, and we have talked about this as a future enhancement.
In the interim, we advise users who are interested in versioning
any of these entities to simply output the specs to files and check the
files in.
<p>
To version branch views, you could use a wrapper script for the
<b>p4 branch</b> command. E.g., say you had a script called 'verbranch'
which was invoked as 'verbranch neptune'. The script would do
something like this to allow the user to edit the 'neptune' branch
view and submit the new branch view automatically:
<pre>
p4 sync //depot/entities/neptune.branch
p4 edit //depot/entities/neptune.branch
p4 branch neptune
p4 branch -o > $MYCLIENT/entities/neptune.branch
p4 submit //depot/entities/neptune.branch
</pre>
Your script could also restore previous versions of the branch view.
E.g., 'verbranch neptune -r@456' would restore the branch view to the
way it looked back when the highest changelist in the depot was 456:
<pre>
p4 sync //depot/entities/neptune.branch
p4 edit //depot/entities/neptune.branch
p4 print -q //depot/entities/neptune.branch@456 | p4 branch -i neptune
p4 branch -o > $MYCLIENT/entities/neptune.branch
p4 submit //depot/entities/neptune.branch
</pre>
</blockquote>
<p>
<i>(April 1998)</i>
</p>
<font size=-2><b><a href="branching.html#br06">[INDEX]</a></b></font>
<hr>
<h6>This is file $Id: //guest/laura_wingerd/perforce/faq/br06.html#2 $ in the
<a href="http://public.perforce.com/public/index.html">Perforce Public Depot</a></h6>
</body>
</html>