Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Reopen and revert files in perforce.

rajeshkumar created the topic: Reopen and revert files in perforce.
If the perforce user access has been removed/blocked from user table and they have so many files opened. There could be two ways to to revert the files.

Problem:
p4 -p server:port -u username -c clientname -H hostname revert //…
Access for user ‘username ‘ has not been enabled by ‘p4 protect’.
p4 -p server:port -u username1 -c clientname -H hostname revert -k //… ( tried using differernt user ‘username’)
//depot/rajesh/file1.txt#none – belongs to user username, not reverted

Solution 1:
So I found one solution for it
another user could take ownership of the files. Here’s an example:
Users ‘rajesh’ and ‘kumar’ have each opened a file in workspace ‘temporary’.
>p4 opened -a //depot/test…
//depot/test.js#3 – edit default change (xtext) by rajesh@temporary
//depot/test2.js#2 – edit default change (text) by kumar@temporary

I use the ‘reopen’ command to change the user:
>p4 -u kumar -c temporary reopen //depot/test…
//depot/test.js#3 – reopened; user kumar
//depot/test2.js#2 – reopened; user kumar

As these changes are now ‘mine’, I can revert them (noting the ‘-k’ flag here):
>p4 -u kumar -c temporary revert -k //depot/test…
//depot/test.js#3 – was edit, cleared
//depot/test2.js#2 – was edit, cleared

Solution 2: Add the missing user for temporary and follow the steps as in problem statement
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Re: Reopen and revert files in perforce.
Problem

Error message when you try to delete the clientspec of users
Client ‘rajesh-test-client’ has files shelved; use ‘shelve -df’ to remove them, and then try again.

Solution:

Some times you may not able to delete client spec and user due to many reason. if user has opened few files in another users clientspec. please follow the steps as given

p4 -p server:port -u username users | grep username
p4 -p server:port -u username clients | grep username
p4 -p server:port -u username client -f -d clientname
p4 -p server:port -u username user -d -f username
p4 -p server:port -u username opened -C clientname //…
p4 -p server:port -u username client clientname
p4 -p server:port -u username describe 662626
p4 -p server:port -u username protect -o | grep jfung
p4 -p server:port -u username protect
p4 -p server:port -u username login jfung
p4 -p server:port -u username -c clientname -H localhost.localdomain revert -k //…
p4 -p server:port -u username clients | grep username
p4 -p server:port -u username opened -u username //…
p4 -p server:port -u username client -d -f clientanam
p4 -p server:port -u username user -d -f username
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Re: Reopen and revert files in perforce.
Problem: One more very interesting scenario where there is no files pending but few files shelved in pending change list.

Answer:
p4 -p server:port -u username client -d -f worksapce_name
Client ‘worksapce_name’ has files shelved; use ‘shelve -df’ to remove them, and then try again.

p4 -p server:port -u username opened -a //… | grep worksapce_name
NONE

p4 -p server:port -c clientname changes -s pending -c workspace_name //…
Change 217927 on 2011/07/13 by username@workspace_name *pending* ‘ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Re: Reopen and revert files in perforce.
How to reverts file opened by Perforce user?
To Revert these changes –
This will list down the files and client’s name where the file has been opened.
p4 -p Server:port -u rajesh opened –a | grep other_user

Now get the host name of the client,
p4 -p Server:port -u rajesh client -o admin-ols-dump | grep –i host

Login as user from super user account.
p4 -p Server:port -u rajesh login other_user

Frame the commands and run it in the given fashion.
p4 -p Server:port -u other_user -c -h revert -k //depot/releases/filename.txt
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Perforce 2014 Server Upgrade Runbook: Verify, Checkpoint, Restore, and Validate

This guide converts the original Perforce 2014 upgrade notes into a practical runbook for production admins. It covers pre-checks, checkpoint-based recovery, post-upgrade verification, and migration cautions.

Read More

Perforce Server Disk Cleanup and Repository Size Management: A Safe, Practical Playbook

Running out of storage on a Perforce (Helix Core) server can quickly become an availability risk. This guide shows a safer cleanup workflow: measure space first, compare options, then execute changes with minimal operational risk.

Read More

Perforce Interview Prep: Essential p4 Commands for Workspaces, Changelists, and Admin Tasks

A practical Perforce interview refresher focused on high-value commands and admin concepts from real usage. Learn how to query changelists, exclude files, use metadata options, and avoid risky data-removal mistakes.

Read More

Perforce Training Guide: Hands-On P4 Curriculum for Users, SCM Engineers, and Release Teams

This revised guide turns a legacy Perforce training announcement into a practical reference for planning team enablement. It summarizes the syllabus, lab workflow, core P4 command areas, and post-training adoption practices.

Read More

Perforce Backup Commands: Checkpoints, Journal Rotation, and Restore Workflow

This guide explains the core Perforce backup commands from the original post and how to use them in a practical backup and restore workflow. You will get a command reference, comparison tables, and ready-to-adapt examples.

Read More

Perforce Tools Explained: Clients, Servers, Plug-ins, and Utilities (Legacy 2012 Reference)

This updated reference explains the Perforce tools listed in the original 2012 post, what each component does, and how they fit together. It also includes a practical p4 CLI workflow and cautions for legacy or renamed components.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x