d fddlZddlZddlZddlmZddlmZeeZGddZ dS)N)shell)minimal_loggerc8eZdZdZd dZd dZd dZdZdZd S) Gitc||_|dz|_tjd|jztjd|jzdS)Nz/.gitz=cd %s && git config --global user.email "robot@dreamhost.com"z.cd %s && git config --global user.name "Robot")pathgit_pathrcmd)selfrs 8/home/matt/dreamhost/git/dreamhost/dhwp/dhwp/core/git.py__init__z Git.__init__ sL w  QTXT]]^^^ BTYNOOOOOctjd\}}}|dkr.tdt jdt j|js6td|jzt jdd|jd|j d|d|}t d |ztj|\}}}| d }| d }t d |d||dkr1td |zt jd|S) Nz which gitrz(cannot find git, please install it firstzERROR: %s is not a directoryzcd z && git --git-dir= zgit command : %szutf-8z git output : zGIT failed with error %s) rr LOGfatalsysexitosrisdirr infodecode)r r argsouterrcodecommands r r zGit.cmdsH;//S$ !88 II@ A A A HQKKKw}}TY''  II4ty@ A A A HQKKK8>/ * * ' Io & & & & & ' 'rc|jdz}t|d5}|d|r|d|r|dddddS#1swxYwYdS)Nr!wzI/.gitignore wp-content/cache wp-content/upgrade wp-config.php /.htaccess z*wp-content/uploads/* wp-content/gallery/* zwp-content/updraft **/*.sql wp-content/backups wp-snapshot wp-content/ai2wm-backups wp-content/**/*.zip wp-content/**/*.gz wp-content/**/*.tar )ropenwrite)r r*r+r,gis r r%zGit.git_ignore9s)m3 /3 ' ' 2 HHe f f f IGHHH$ @                  sAA,,A03A0c<|d}d|vrdSdS)Nstatusznothing to commitrr)r )r results r r&zGit.has_changesGs((## & ( (11rc<|jdz}tj|rtj|tj|jr:t jd|jzt jd|jzdSdS)Nr!zgit --git-dir=%s worktree prunezrm -rf )rrr'r(rr rr )r r,s r wipezGit.wipeNs)m3 7>>/ * * ' Io & & & 7== ' ' 1 I7$-G H H H Ii$-/ 0 0 0 0 0 1 1rN)r)rFF)FF) __name__ __module__ __qualname__r r r$r%r&r7rr rr sPPP 6 ' ' ' '    11111rr) rerrcementrcement.utils.miscrr8rrr;rr r?s ,,,,,,nXL1L1L1L1L1L1L1L1L1L1r