Browse Source

Minor cleanup.

testing
Brian Ernst 2 years ago
parent
commit
3aa1373758
  1. 6
      README.md
  2. 7
      p4RemoveUnversioned.py
  3. 5
      p4SyncMissingFiles.py

6
README.md

@ -1,7 +1,11 @@
p4Tools
===================
Removes unversioned files from perforce repository.
Perforce script tools for:
* Remove unversioned files
* Parallel sync missing files
* Parallel sync everything
* Etc.
Script is in beta, works well, but still going through continued testing. There are a few stats at the end, will be putting in more, like number of files/directories checked, so you have an idea how much work was required. One of the reasons this is still in testing is because sometimes the end of the script gets stuck when closing Console logging; I haven't had the time or care to fix this, so it's not considered stable or production ready for at least that reason.

7
p4RemoveUnversioned.py

@ -4,11 +4,9 @@
# python_version : 2.7.6 and 3.4.0
# =================================
# todo: switch to `p4 fstat ...`, and parse the output for clientFile and cache it.
# todo: have a backup feature, make sure files are moved to the recycle bin or a temporary file.
# todo: switch to faster method of calling p4 fstat on an entire directory and parsing it's output
# todo: add option of using send2trash
# todo: buffer output, after exceeding a certain amount print to the output.
# todo: switch to faster method of calling p4 fstat on an entire directory and parsing it's output
# todo: allow logging output besides console output, or redirection altogether
from p4Helper import *
@ -55,7 +53,8 @@ def main( args ):
# TODO: push this off to a thread and walk the directory so we get a headstart.
files_in_depot = get_client_set( directory )
c.writeflush( "|Done." )
if not options.quiet:
c.writeflush( "|Done." )
# TODO: push a os.walk request off to a thread to build a list of files in the directory; create batch based on directory?

5
p4SyncMissingFiles.py

@ -19,7 +19,7 @@ class P4SyncMissing:
fail_if_no_p4()
#http://docs.python.org/library/optparse.html
#http://docs.python.org/library/optparse.html
parser = optparse.OptionParser( )
parser.add_option( "-d", "--dir", dest="directory", help="Desired directory to crawl.", default=None )
@ -93,7 +93,8 @@ class P4SyncMissing:
threads.append( t )
t.start( )
c.writeflush( " Done." )
if not options.quiet:
c.writeflush( " Done." )
make_drive_upper = True if os.name == 'nt' or sys.platform == 'cygwin' else False

Loading…
Cancel
Save