diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -911,11 +911,13 @@ class Project(object): | |||
911 | else: | 911 | else: |
912 | return False | 912 | return False |
913 | 913 | ||
914 | def PrintWorkTreeStatus(self, output_redir=None): | 914 | def PrintWorkTreeStatus(self, output_redir=None, quiet=False): |
915 | """Prints the status of the repository to stdout. | 915 | """Prints the status of the repository to stdout. |
916 | 916 | ||
917 | Args: | 917 | Args: |
918 | output: If specified, redirect the output to this object. | 918 | output: If specified, redirect the output to this object. |
919 | quiet: If True then only print the project name. Do not print | ||
920 | the modified files, branch name, etc. | ||
919 | """ | 921 | """ |
920 | if not os.path.isdir(self.worktree): | 922 | if not os.path.isdir(self.worktree): |
921 | if output_redir is None: | 923 | if output_redir is None: |
@@ -941,6 +943,10 @@ class Project(object): | |||
941 | out.redirect(output_redir) | 943 | out.redirect(output_redir) |
942 | out.project('project %-40s', self.relpath + '/ ') | 944 | out.project('project %-40s', self.relpath + '/ ') |
943 | 945 | ||
946 | if quiet: | ||
947 | out.nl() | ||
948 | return 'DIRTY' | ||
949 | |||
944 | branch = self.CurrentBranch | 950 | branch = self.CurrentBranch |
945 | if branch is None: | 951 | if branch is None: |
946 | out.nobranch('(*** NO BRANCH ***)') | 952 | out.nobranch('(*** NO BRANCH ***)') |
@@ -2394,6 +2400,7 @@ class Project(object): | |||
2394 | src = os.path.realpath(os.path.join(srcdir, name)) | 2400 | src = os.path.realpath(os.path.join(srcdir, name)) |
2395 | # Fail if the links are pointing to the wrong place | 2401 | # Fail if the links are pointing to the wrong place |
2396 | if src != dst: | 2402 | if src != dst: |
2403 | _error('%s is different in %s vs %s', name, destdir, srcdir) | ||
2397 | raise GitError('--force-sync not enabled; cannot overwrite a local ' | 2404 | raise GitError('--force-sync not enabled; cannot overwrite a local ' |
2398 | 'work tree. If you\'re comfortable with the ' | 2405 | 'work tree. If you\'re comfortable with the ' |
2399 | 'possibility of losing the work tree\'s git metadata,' | 2406 | 'possibility of losing the work tree\'s git metadata,' |