Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
627 B

  1. import sys
  2. import os
  3. import re
  4. def PrintUsage():
  5. print "p4EditChangelist.py [changelist #]"
  6. print " - Checks out all the files in the specified changelist."
  7. if len( sys.argv ) < 2:
  8. PrintUsage()
  9. sys.exit( 1 )
  10. sChangelist = sys.argv[1]
  11. f = os.popen2( 'p4 describe -s %s' % sChangelist )
  12. allText = f[1].read()
  13. #f.close()
  14. #print allText
  15. # Now match an RE to get each filename.
  16. testRE = re.compile( r'\.\.\. (?P<fn>//.+)#\d+ ', re.IGNORECASE )
  17. startPos = 0
  18. while 1:
  19. m = testRE.search( allText, startPos )
  20. if not m:
  21. break
  22. filename = m.group('fn')
  23. startPos = m.end()
  24. os.system( 'p4 edit "%s"' % filename )