NavicoOS / ac2git

Tool to convert an AccuRev repository to Git.
29 stars 15 forks source link

Fixed dealing with readonly files. #115

Closed Digitalroot closed 6 years ago

Digitalroot commented 6 years ago

Script would crash when a file in AccuRev was set as read only.

PermissionError: [WinError 5] Access is denied: 'D:\path\to\readonly\file.txst'

This change catches the exception and then removes the readonly flag, and tries to delete the file a second time.

Note: I ran into this problem on Win7, Py 3.4, AccuRev 7.0, Git 2.16.1.windows.1

Digitalroot commented 6 years ago

The files became read only because we use AccuRev's exclusive lock feature, which checkouts a file as read only, unless you have the lock on it.

More Info: https://documentation.microfocus.com/help/index.jsp?topic=%2Fcom.microfocus.accurev.concepts.doc%2FGUID-9FAC48A1-F973-4CC3-869D-2C1D174EF648.html