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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Step by step guide on PerforceDFiles Tool | Perforce Tutorial

Step-by-Step Guide on PerforceDFiles Tool PerforceDFiles is a diagnostic tool used in Perforce Helix Core (P4) to list, analyze, and delete orphaned or corrupted files from the…

Read More

Ruby and Perl Script to find all Perforce users who have not set passwords

These scripts will:✅ Connect to the Perforce server✅ Retrieve a list of users✅ Identify users without passwords 1. Prerequisites Before running the scripts, ensure:✔ Perforce CLI (p4)…

Read More

Ruby and Perl Scripts to List Perforce Clients in Descending Access Date Order

These scripts will:✅ Connect to the Perforce server✅ Retrieve a list of clients (workspaces)✅ Sort them by last access date (descending order) 1. Prerequisites Before running the…

Read More

The P4Win Window Navigation Guide in Perforce

P4Win Window Navigation Guide P4Win (Perforce for Windows) has a classic Windows-style interface, making it easy to navigate for developers familiar with GUI-based version control. This guide…

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