aboutsummaryrefslogtreecommitdiff
path: root/tools/refactoring/p4commands.py
blob: 71ac31b0d0b7746b3538f1384ec62891ae02d8a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import filemanagement

# checks out entire p4 repository
def checkoutallfiles():
    os.system('p4 edit //depotGoogle/...')
    return

# reverts all unchanged files, this is completely innoculus
def revertunchangedfiles():
    os.system('p4 revert -a //depotGoogle/...')
    return

def integratefile( old_name, new_name):
    if(old_name == new_name):
        return
    if(not filemanagement.fileexist(old_name)):
        return
    integrate_command = 'p4 integrate -o -f ' +\
                        old_name +\
                        ' ' +\
                        new_name +\
                        ' > p4summary.txt 2> error.txt'
    os.system(integrate_command)
    #print integrate_command
    delete_command = 'p4 delete -c default ' +\
                     old_name +\
                     ' > p4summary.txt 2> error.txt'
    os.system(delete_command)
    #print delete_command
    return