Jump to content


Streams and generated files - can you keep, but not track generated files in p4?

.p4ignore streams workspace clientspec

  • Please log in to reply
2 replies to this topic

#1 mcru

mcru

    Advanced Member

  • Members
  • PipPipPip
  • 67 posts

Posted 05 June 2017 - 10:41 PM

I'm doubting this is possible, but with streams behavior of being able to shelve/unshelve changes automatically when switching streams in a single workspace, I was wondering if it's possible to have files that are generated from a build or other process be tracked by a stream so they are saved when switching streams, but not be shown as tracked by p4 when you run p4 status.

For example, say my build generates some .data files in a data directory. I'm working in stream_A and I run a build to generate the .data files. I make a few more changes, and then need to switch to stream_B to make a quick bug fix. When I switch to stream_B, I would want my generated .data files from stream_A to be saved along with the changes I made on that stream. Then, when I build on stream_B, I would like the generated data files to write on stream_B. Then, when I switch back to stream_A, I would like the generated data files from my original stream_A build to be put back into place. If the files are tracked by p4 this works, but when I run p4 status, I don't want the contents of the data directory to be shown. I've tried using a .p4ignore file to ignore the data directory, but then when I switch to another stream, the data directory stays in place, and when I switch back to my previous stream, the contents is not reverted... it stays the same as it was at last mod time (which makes sense, I'm telling p4 to ignore the files). What I'm hoping for is some middle ground, where p4 will locally track files, but be restricted from submitting or showing in p4 status.

#2 CarolineB

CarolineB

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts

Posted 08 June 2017 - 07:47 AM

I guess you could write a script to do that (and thus a Custom Tool, if you use P4V)

My piece of advice, very seldom followed, but which makes it possible to avoid so many problems, with all tools: have your built stuff not stored in your source files hierarchy :) If you have your built stuff stored in a separate hierarchy, whose entry point name depends on your workspace/stream & build procedure, you can manage that so easily...

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 12 June 2017 - 02:09 AM

I'd just use different workspaces at that point so each stream has its own local directory.  Then just add those files to your ignore (whether P4IGNORE or the stream spec or whatever).  If you never "p4 switch" you don't need to worry about those local files ending up juxtaposed with the wrong depot files.





Also tagged with one or more of these keywords: .p4ignore, streams, workspace, clientspec

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users