diff --git a/README.md b/README.md index 20a3620..1f22b4f 100644 --- a/README.md +++ b/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. diff --git a/p4RemoveUnversioned.py b/p4RemoveUnversioned.py index ea9cbf2..da3d3a1 100644 --- a/p4RemoveUnversioned.py +++ b/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? diff --git a/p4SyncMissingFiles.py b/p4SyncMissingFiles.py index 1eecdcd..ca733c9 100644 --- a/p4SyncMissingFiles.py +++ b/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