Detecting Perforce unopened modified files

前端 未结 5 1925
春和景丽
春和景丽 2021-01-30 17:54

I\'m trying to figure out a way to detect files that are not opened for editing but have nevertheless been modified locally. p4 fstat returns a value headModT

相关标签:
5条回答
  • 2021-01-30 18:03

    This SO question gives a way to do this in the P4V GUI:

    In the Jan 2009 version of P4V, you can right-click on any folder in your workspace tree and click "reconcile offline work..."

    This will do a little processing then bring up a split-tree view of files that are not checked out but have differences from the depot version, or not checked in at all. There may even be a few other categories it brings up.

    You can right-click on files in this view and check them out, add them, or even revert them.

    Later EDIT:

    In the "Reconcile..." window, you can click 'Advanced Reconcile' and be presented with a two-pane, folder hierarchy diff window which is especially useful for finding files you need to add.

    PROS: This whole P4V feature is more user-friendly than the command-line version (because it allows utmost granularity in selecting what to reconcile)

    CONS: It is in dire need of a subversion/git/hg .ignore-like list, to spare you the pain of manually skipping all the dll's and other cruft in your projects.

    0 讨论(0)
  • 2021-01-30 18:07

    As of Perforce version 2012.1, use the command line commands p4 status and p4 reconcile

    http://www.perforce.com/perforce/r12.2/manuals/cmdref/status.html

    The p4 status command finds unopened files in a client's workspace and detects the following three types of inconsistencies between your workspace and the depot:

    1. Files present in the depot, present in your have list, but missing from your workspace. By default, these files are then opened for delete.
    2. Files present in your workspace, but missing on the depot. By default, these files are opened for add.
    3. Files modified in your workspace that are not open for edit. By default, these files are opened for edit.

    http://www.perforce.com/perforce/r12.1/manuals/cmdref/reconcile.html

    0 讨论(0)
  • 2021-01-30 18:09

    Here's a unix solution that has worked very well for me.

    How to find untracked files in a Perforce tree? (analogue of svn status)

    0 讨论(0)
  • 2021-01-30 18:17

    From: http://answers.perforce.com/articles/KB/3481/?q=disconnected&l=en_US&fs=Search&pn=1

    See step 2 specifically:


    2 . Next, open for "edit" any files that have changed:

    p4 diff -se //myclient/... | p4 -x - edit
    

    p4 diff -se returns the names of depot files whose corresponding client file differs in any way from the clients #have revision.

    0 讨论(0)
  • 2021-01-30 18:18

    From the working disconnected article, using p4win you can also select the folder/files in question and select 'file menu->more->check consistency' which basically does the 'p4 diff -se' and 'p4 diff -sd', and prompts the user to resolve the inconsistencies.

    0 讨论(0)
提交回复
热议问题