diff options
Diffstat (limited to 'devtools/p4EditChangelist.py')
| -rw-r--r-- | devtools/p4EditChangelist.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/devtools/p4EditChangelist.py b/devtools/p4EditChangelist.py new file mode 100644 index 0000000..a640908 --- /dev/null +++ b/devtools/p4EditChangelist.py @@ -0,0 +1,35 @@ + +import sys +import os +import re + + + +def PrintUsage(): + print "p4EditChangelist.py [changelist #]" + print " - Checks out all the files in the specified changelist." + + +if len( sys.argv ) < 2: + PrintUsage() + sys.exit( 1 ) + + +sChangelist = sys.argv[1] +f = os.popen2( 'p4 describe -s %s' % sChangelist ) +allText = f[1].read() +#f.close() +#print allText + +# Now match an RE to get each filename. +testRE = re.compile( r'\.\.\. (?P<fn>//.+)#\d+ ', re.IGNORECASE ) +startPos = 0 +while 1: + m = testRE.search( allText, startPos ) + if not m: + break + + filename = m.group('fn') + startPos = m.end() + + os.system( 'p4 edit "%s"' % filename ) |