mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-31 14:39:19 +00:00
1
This commit is contained in:
@@ -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 )
|
||||
Reference in New Issue
Block a user