def run_filelog( self, *args ):
      raw = self.run( 'filelog', args )
      if (not self.tagged): 
          # untagged mode returns simple strings, which breaks the code below
          return raw
      result = []
      for h in raw:
          r = None
          if isinstance( h, dict ):
              df = DepotFile( h[ "depotFile" ] )
              for n, rev in enumerate( h[ "rev" ]):
                  # Create a new revision of this file ready for populating
                  r = df.new_revision()
                  # Populate the base attributes of each revision
                  r.rev = int( rev )
                  r.change = int( h[ "change" ][ n ] )
                  r.action = h[ "action" ][ n ] 
                  r.type = h[ "type" ][ n ]
                  r.time = datetime.datetime.utcfromtimestamp( int( h[ "time" ][ n ]) )
                  r.user = h[ "user" ][ n ]
                  r.client = h[ "client" ][ n ]
                  r.desc = h[ "desc" ][ n ]
                  if "digest" in h:
                    r.digest = h[ "digest" ][ n ]
                  if "fileSize" in h:
                    r.fileSize = h[ "fileSize" ][ n ]

                  # Now if there are any integration records for this revision,
                  # add them in too
                  
                  if (not "how" in h) or (n >= len(h["how"]) or h["how"][n] == None):
                      continue
                  else:
                      for m, how in enumerate( h[ "how" ][ n ] ):
                          file = h[ "file" ][ n ][ m ]
                          srev = string.lstrip(h[ "srev" ][ n ][ m ], '#')
                          erev = string.lstrip(h[ "erev" ][ n ][ m ], '#')
                          
                          if srev == "none":
                              srev = 0
                          else:
                              srev = int( srev )
                        
                          if erev == "none":
                              erev = 0
                          else:
                              erev = int( erev )
                              
                          r.integration( how, file, srev, erev )
          else:
              r = h
          result.append( df )
      return result
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/common/perforce/p426/win64/P4.py/P4.run_filelog/original