Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4266650
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:47:23+00:00 2026-05-21T06:47:23+00:00

I have a number of files checked out with changes ready to submit. I

  • 0

I have a number of files checked out with changes ready to submit.

I realised that my client spec was hardcoding my alternate root, so I removed the alternate root from all lines in the client spec, and specified it in the alternate root box instead.

I also had some files not checked out that I wasn’t ready to add to changelists so I renamed the directory structure underneath and then synced all branches I needed and then renamed the directory to AltBranch and renamed the old one back.

Now however all the checked out files are listed as “not mapped to workspace view” – they are still there however.

I wanted to force perforce to agree with my version, so I tried p4 sync -k, however I get the error

//.../X.cpp#10 - is opened for edit and can't be deleted

I then tried p4 sync -k -f, but I get the error

//.../X.cpp#10 - refreshing C:\Work\...\X.cpp
//.../X.cpp#10 - is opened for edit and can't be deleted

On the whole I really like Perforce, however its insistence in always knowing best is frustrating

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:47:23+00:00Added an answer on May 21, 2026 at 6:47 am

    I have managed to produce a batch file that contains a sequence of Perforce commands to achieve what I want.

    This solution is Windows/DOS specific – although I would imagine other command shells could do the parsing needed for this fix:

     @ echo off
     echo Please Exit Perforce
     pause
     setlocal
     rem Retrieve depot spec format of file
     for /f "delims=# " %%d in ('p4 files %1') do set p4name=%%d
     rem Retrieve current pending changelist
     for /f "tokens=5 delims= " %%d in ('p4 opened %p4name%') do set change=%%d
     p4 revert -k %p4name%
     p4 sync -k %p4name%
     p4 edit -c %change% %1
    

    This version is specific to files, although a directory version would be possible substituting files for dirs

    Also stupidly the Command Prompt does not set ERRORLEVEL if the command in the ticks fails.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number of data files to process from a data warehouse that
I have a large number of csv files that look like this below: xxxxxxxx
I have a number of large data files that I included in projects attributed
I have developed a Java program that will count the number of files in
I have to figure out the most recently checked in files on VSS. I
I have a VBScript that does a number of tasks, including moving files from
I have checked out some files from subversion repository. After building, there are a
I have a number of files I am loading into a slideshow, I have
I have a number of source files I want to agglomerate into a .a
I have a number of .css files spread across some directories. I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.