Jump to content


p4 reconcile -w -f and -//workspace/excludes/...


  • Please log in to reply
3 replies to this topic

#1 callmewilko

callmewilko

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 06 July 2018 - 10:29 AM

I'm trying to use "p4 reconcile -w -f" to clean a workspace in between builds, and it's leaving behind some files that are not in the repo.

Assume a workspace like this, which excludes 'tests' directories to save time and space:

//top/... //workspace/top/...
-//top/.../tests/... //workspace/top/.../tests/...

A build step causes the local creation of the following (note the "/tests/" in the 2nd path):

//top/module1/code/3rdpartything/thing.c
//top/module1/code/3rdpartything/stuff/tests/testthing.c

Running "p4 reconcile -w -f" correctly removes

//top/module1/code/3rdpartything/thing.c

but leaves behind

//top/module1/code/3rdpartything/stuff/tests/testthing.c

Can anyone come up with a way to rewrite the -//workspace/.../exclude/... or alter the clearup command such that "p4 reconcile" actually deletes these temporary, uncontrolled artefacts?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 548 posts

Posted 07 July 2018 - 01:09 AM

For the workflow you describe I don't think it makes sense to exclude those files from the client view.

If you simply remove the exclusion, then Perforce commands (including "clean" aka "reconcile -w") will be able to operate on those files.

#3 callmewilko

callmewilko

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 08 July 2018 - 09:55 AM

Thanks for taking time to help out ... Given your comment I think I misused "//" in the original post, and made it look at a glance like the directories I need "cleaned" are in the repo - they are not. I should have shown directory paths.

Quote

If you simply remove the exclusion, then Perforce commands (including "clean" aka "reconcile -w") will be able to operate on those files.

That's true. However I want to exclude the .../tests/... repo data as our checkout is transatlantic and that saves not inconsiderable time as well as disk space, so removing that line works around the clean up problem (which feels like a bug to me) but increases build time.

To make it hopefully clearer, take this as an on disk workspace layout:

/my/p4/workspace/my_real_code.c # from //repo/my_real_code.c
/my/p4/workspace/tests/my_massive_test_stuff.c   # from //repo/tests/my_massive_test_stuff.c
/my/p4/workspace/3rdpartything/thing.c # not in the repo at all (generated at build time)
/my/p4/workspace/3rdpartything/stuff/tests/testthing.c   # not in the repo at all (generated at build time)

The goals are that:
1 On checkout I can avoid all version controlled directories with "/tests/" in the path
2 On cleanup I can remove everything which is not version controlled from the workspace
3 On cleanup I can make sure everything which is version controlled is as per repo

I can meet goals 1 and 3 with this in the workspace spec:
-//repo/.../tests/... //workspace/.../tests/...

But that has the side effect of making "clean" skip over 3rdpartything/stuff/tests/, even though the directory tree 3rdpartything/ is not even in the repo.

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 548 posts

Posted 09 July 2018 - 05:30 PM

Can you add "3rdpartything" to your view, then?

//repo/... //workspace/...
-//repo/.../tests/... //workspace/.../tests/...
//repo/do-not-submit/... //workspace/3rdpartything/...

The reason that path is currently skipped by "clean" is that if something isn't mapped in your view, it's not part of your workspace.  "p4 clean" will no more delete those files than it would delete your /usr/local/bin folder.  :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users