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 233231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:05:01+00:00 2026-05-11T20:05:01+00:00

I’m working on a script to interact with Perforce, which among other things needs

  • 0

I’m working on a script to interact with Perforce, which among other things needs to be able to understand pending changelists. For this I use ‘p4 describe‘ and ‘p4 opened‘, which are pretty straightforward. For instance, a file opened for edit shows up like this (from p4 opened):

//source/stuff/things.h#1 add default change (text)

What I can’t seem to figure out is how to detect cases where a user has branched a file and then used the ‘Reopen for edit’ command on that file (which amounts to using ‘p4 edit‘ on the file to be branched) prior to submitting it. Same thing goes for integrating a file and then using ‘Reopen for edit’ before submitting the integration. In the branch case, the file shows up as an ‘add’ with no indication that there’s also a branch going on (so the above example could be either a true add or a reopened branch). In the integrate case it, shows up as an ‘edit’. In both cases, after I submit the change I can see that the file was branched/integrated, but I need to be able to do this for pending changes. In theory I would hope to see something like this, where things.h is being branched and edited from thangs.h:

//source/stuff/things.h#1 add default change (text)
  branch from //source/other/thangs.h#42

Does anybody know of a way to accomplish this? I’ll also mention that I’m running an old-ish version of Perforce (from 2004), so perhaps it’s doable in newer versions and I just need to update my software.

  • 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-11T20:05:01+00:00Added an answer on May 11, 2026 at 8:05 pm

    I do not think that this is possible when issuing a “reopen for edit”. As you have already indicated, the reopen command will change a files status to something different. I ran a local test (I’m running 2008.2). There do seem to be some changes in the way that perforce reports on the add/edit status of files since your version, but what you are trying to do still doesn’t seem possible

    d:\sandbox\ctg_test>p4 integ test.txt test_branch.txt
    //ctg_test/test_branch.txt#1 - branch/sync from //ctg_test/Test.txt#1,#15
    
    d:\sandbox\ctg_test>p4 opened
    //ctg_test/test_branch.txt#1 - branch default change (text)
    

    Note that the opened command now shows ‘branch’ for the file status instead of add which I think it might have shown with your version of the server. But the kicker:

    d:\sandbox\ctg_test>p4 edit test_branch.txt
    //ctg_test/test_branch.txt#1 - reopened for add
    
    d:\sandbox\ctg_test>p4 opened
    //ctg_test/test_branch.txt#1 - add default change (text)
    

    I tried looking with the -ztag option to see if more info was given:

    d:\sandbox\ctg_test>p4 -ztag opened
    ... depotFile //ctg_test/test_branch.txt
    ... clientFile //client-mark.allender/ctg_test/test_branch.txt
    ... rev 1
    ... action add
    ... change default
    ... type text
    ... user mark.allender
    ... client client-mark.allender
    

    p4 fstat was no help either.

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

Sidebar

Ask A Question

Stats

  • Questions 167k
  • Answers 167k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Enum.valueOf (or rather, its wrapper which is synthesized in and… May 12, 2026 at 1:28 pm
  • Editorial Team
    Editorial Team added an answer You can think of CoCreateInstance() as an interface to an… May 12, 2026 at 1:28 pm
  • Editorial Team
    Editorial Team added an answer Given the following types: public interface IFruit { String name… May 12, 2026 at 1:28 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
In order to apply a triggered animation to all ToolTip s in my app,
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.