diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -1515,6 +1515,7 @@ class Project: | |||
| 1515 | self, | 1515 | self, |
| 1516 | syncbuf, | 1516 | syncbuf, |
| 1517 | force_sync=False, | 1517 | force_sync=False, |
| 1518 | force_checkout=False, | ||
| 1518 | submodules=False, | 1519 | submodules=False, |
| 1519 | errors=None, | 1520 | errors=None, |
| 1520 | verbose=False, | 1521 | verbose=False, |
| @@ -1602,7 +1603,7 @@ class Project: | |||
| 1602 | syncbuf.info(self, "discarding %d commits", len(lost)) | 1603 | syncbuf.info(self, "discarding %d commits", len(lost)) |
| 1603 | 1604 | ||
| 1604 | try: | 1605 | try: |
| 1605 | self._Checkout(revid, quiet=True) | 1606 | self._Checkout(revid, force_checkout=force_checkout, quiet=True) |
| 1606 | if submodules: | 1607 | if submodules: |
| 1607 | self._SyncSubmodules(quiet=True) | 1608 | self._SyncSubmodules(quiet=True) |
| 1608 | except GitError as e: | 1609 | except GitError as e: |
| @@ -2857,10 +2858,12 @@ class Project: | |||
| 2857 | except OSError: | 2858 | except OSError: |
| 2858 | return False | 2859 | return False |
| 2859 | 2860 | ||
| 2860 | def _Checkout(self, rev, quiet=False): | 2861 | def _Checkout(self, rev, force_checkout=False, quiet=False): |
| 2861 | cmd = ["checkout"] | 2862 | cmd = ["checkout"] |
| 2862 | if quiet: | 2863 | if quiet: |
| 2863 | cmd.append("-q") | 2864 | cmd.append("-q") |
| 2865 | if force_checkout: | ||
| 2866 | cmd.append("-f") | ||
| 2864 | cmd.append(rev) | 2867 | cmd.append(rev) |
| 2865 | cmd.append("--") | 2868 | cmd.append("--") |
| 2866 | if GitCommand(self, cmd).Wait() != 0: | 2869 | if GitCommand(self, cmd).Wait() != 0: |
