Jump to content


p4 sync not behaving as expected. What am I doing wrong?


  • Please log in to reply
2 replies to this topic

#1 dgnuff

dgnuff

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 01 June 2019 - 03:53 AM

I will occasionally want to forcibly update a folder within my workspace to the current head of the depot.  To do this, I use something like the following command:

p4 sync -f C:\Etc\dev\work\libjpeg/... #head

which should only forcibly update files under the named folder.  Even when executed while in the target folder, it still updates the entire workspace.  Usually this isn't harmful, but t's still a load of extra work that doesn't need to be done.

What is the correct way to restrict this to strictly the files under C:\Etc\dev\work\libjpeg and nothing else in the workspace?

Operating system: Windows 10.
Perforce version 2019.1

#2 Dave Foglesong

Dave Foglesong

    Member

  • Members
  • PipPip
  • 13 posts

Posted 01 June 2019 - 06:29 AM

The command above has a space between the "..." and "#head". If that's actually what you're running, that's passing two paths to the sync command -- so it's syncing "C:\Etc\dev\work\libjpeg/..." and then it's syncing your entire workspace to "#head".

If you remove the space it will do what you want. But since #head is the default rev to sync to ("p4 sync -f //some/path/..." and "p4 sync -f //some/path/...#head" do the same thing), you don't really need the "#head" rev specification here.

#3 Morris7

Morris7

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 15 June 2019 - 05:35 AM

yaa removing the space would help...DO that and it will most probably solve the problem




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users