MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

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 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 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

How to Use `p4 duplicate` for a Perforce Branch Path Rename (Deep Rename)

When you need to move a Perforce branch path while preserving revision and integration history, `p4 duplicate` is the key command. This guide shows the workflow, exact commands, and cleanup considerations.

Read More

Perforce Changelist Numbers Explained: Default, Numbered, and Submit-Time Renumbering

Perforce changelist numbers are simple once you understand when numbers are assigned and why pending changelists can be renumbered at submit time. This guide clarifies the default changelist, numbered changelists, and practical p4 command usage.

Read More

Perforce Slow Sync Troubleshooting Guide: Latency, DNS, and Storage Bottlenecks

Slow Perforce syncs are often caused by latency, DNS lookups, wildcard handling on Windows, or storage placement issues. This guide gives you a practical workflow, command checks, and remediation paths to isolate the real bottleneck.

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