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

  • SEARCH
  • Home
  • 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 423023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:08:20+00:00 2026-05-12T19:08:20+00:00

I was wondering what could be the point in trying to delete committed changelists,

  • 0

I was wondering what could be the point in trying to delete committed changelists, because a committed changelist is not supposed to be empty.

But then I am playing with the tutorial depot, and using the obliterate command on a whole branch, I can see there are situation where you can end up with empty committed changelists (that need deletion with the -f flag).

However, I don’t know how to find them with the command line, as I don’t know how to look for changelists with no files associated with.

Is there an easy way to do that ?

Thanks,

Thomas

  • 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-12T19:08:21+00:00Added an answer on May 12, 2026 at 7:08 pm

    As I am on Windows, I have created a little script doing the exact same thing in PERL, rather than Shell, powershell or px 🙂 :

    #*******************************************************************************
    # Module:  delete_empty_changelist.pl
    # Purpose: A script to delete empty changelist
    # 
    
    @list = `p4 changes -s submitted`;
    
    foreach $chg (@list)
    {
     $chgnbr = (split /\s+/, $chg)[1];
     print `p4 change -d -f $chgnbr`;
     }     
    exit 0;
    

    Note that in fact, in all cases, it’s not a very clever script: It tries to delete absolutely every submitted changelist, and is prevented by perforce to do so, because if files are associated with it, you will get an error.

    I suppose the result of the script should be sent to a log, and parse, so that only the relevant lines are highlighted.

    Running the script will produce an output similar to:

    Change 857 has 1 files associated with it and can't be deleted.
    Change 856 has 1 fixes associated with it and can't be deleted.
    Change 855 has 1 fixes associated with it and can't be deleted.
    Change 854 deleted.
    Change 853 has 1 fixes associated with it and can't be deleted.
    Change 852 has 8 files associated with it and can't be deleted.
    Change 851 has 1 files associated with it and can't be deleted.
    Change 850 has 2 files associated with it and can't be deleted.
    Change 849 has 2 files associated with it and can't be deleted.
    Change 846 deleted.
    Change 845 has 2 files associated with it and can't be deleted.
    

    Cheers,

    Thomas

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

Sidebar

Related Questions

Just wondering if someone could point me in the right direction of how to
I am wondering if someone could point me in the right direction. You know
I'm just wondering if someone could point me in the right direction here, I
I was wondering if anyone could give me an example or point me to
I was wondering if anyone could point to an Open Source date utility class
Apologies for the lack of a code example but I'm not sure I could
i am wondering could i access my app internal storage using emulator. I mean
Hi sorry still learning here and slow to learning code arguments. Just wondering could
i was wondering how could i emulate a mouse click with c# with kinect.
I'm wondering what could be some consequences of reusing the names of built-in types

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.