Jump to content


How to revert check-in, keeping changes locally?


  • Please log in to reply
3 replies to this topic

#1 BJS

BJS

    Member

  • Members
  • PipPip
  • 16 posts

Posted 03 December 2019 - 08:00 AM

With PV4,
how would I achieve the following:

Start situation: Checked-out file with latest revision + local changes.

Wanted: "Revert" (i.e. don't have the file checked out), but keeping the local changes (locally only, obviously)
Same situation as if the file had never been checked out, but offline changes had been made.

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 976 posts

Posted 04 December 2019 - 04:10 AM

You can't do this in P4V, but from the command line you can do:

p4 revert -k FILE

If you want this functionality to be easily accessible via P4V (although if it's a frequent part of your workflow there's probably a better way of accomplishing it) you can add it as a custom tool that invokes the command line client.

#3 BJS

BJS

    Member

  • Members
  • PipPip
  • 16 posts

Posted 04 December 2019 - 08:37 AM

View PostSambwise, on 04 December 2019 - 04:10 AM, said:

If you want this functionality to be easily accessible via P4V (although if it's a frequent part of your workflow there's probably a better way of accomplishing it) you can add it as a custom tool that invokes the command line client.

Thank you, that is interesting. How exactly would I add this as a tool, i.e. what is the correct way of setting it up in
[...image as attachment...]

?

As an aside: Can I set up a custom tool that opens me p4 console window like that as well?

Attached Thumbnails

  • t.jpg


#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 976 posts

Posted 04 December 2019 - 03:53 PM

If you right-click on a folder, there's an "Open Command Window Here" to open a console window in that folder.

For a "revert -k" custom tool you'd make the "application" p4 and make the "arguments" revert -k %F.

If there are certain files that you want to freely modify in your workspace but not check in, the better solution is usually to exclude them from your workspace's View (or add them to the "ignored" section of your stream if you're using streams).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users