diff options
author | Shawn O. Pearce <sop@google.com> | 2010-03-06 19:29:56 -0800 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2010-03-06 19:29:56 -0800 |
commit | 69b1e8aa65ab933fa919166d88aec90c86852beb (patch) | |
tree | 0a8635a835abfd8c05a04bd03639ab2d07e70d5f /project.py | |
parent | 840ed0fab7cb4c2ab296c7d7d45f13e2523bae1c (diff) | |
parent | 9452e4ec0941fbee163e35ebdcd6ca6ee7df55cb (diff) | |
download | git-repo-69b1e8aa65ab933fa919166d88aec90c86852beb.tar.gz |
Merge branch 'stable'
* stable:
Automatically install Gerrit Code Review's commit-msg hook
Fail sync when encountering "N commits behind."
Check that we are not overwriting a local repository when syncing.
Honor url.insteadOf when setting up SSH control master connection
sync: Fix split call on malformed email addresses
Fixing project renaming bug.
Conflicts:
hooks/commit-msg
project.py
subcmds/sync.py
Change-Id: I5eaf8fef8cbe4a95d124368112293a9ca64325bf
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -706,10 +706,9 @@ class Project(object): | |||
706 | # commits are not yet merged upstream. We do not want | 706 | # commits are not yet merged upstream. We do not want |
707 | # to rewrite the published commits so we punt. | 707 | # to rewrite the published commits so we punt. |
708 | # | 708 | # |
709 | syncbuf.info(self, | 709 | syncbuf.fail(self, |
710 | "branch %s is published but is now %d commits behind", | 710 | "branch %s is published (but not merged) and is now %d commits behind" |
711 | branch.name, | 711 | % (branch.name, len(upstream_gain))) |
712 | len(upstream_gain)) | ||
713 | return | 712 | return |
714 | elif pub == head: | 713 | elif pub == head: |
715 | # All published commits are merged, and thus we are a | 714 | # All published commits are merged, and thus we are a |
@@ -728,7 +727,7 @@ class Project(object): | |||
728 | last_mine = None | 727 | last_mine = None |
729 | cnt_mine = 0 | 728 | cnt_mine = 0 |
730 | for commit in local_changes: | 729 | for commit in local_changes: |
731 | commit_id, committer_email = commit.split(' ', 2) | 730 | commit_id, committer_email = commit.split(' ', 1) |
732 | if committer_email == self.UserEmail: | 731 | if committer_email == self.UserEmail: |
733 | last_mine = commit_id | 732 | last_mine = commit_id |
734 | cnt_mine += 1 | 733 | cnt_mine += 1 |
@@ -1132,7 +1131,10 @@ class Project(object): | |||
1132 | dst = os.path.join(dotgit, name) | 1131 | dst = os.path.join(dotgit, name) |
1133 | if relink: | 1132 | if relink: |
1134 | os.remove(dst) | 1133 | os.remove(dst) |
1135 | os.symlink(relpath(src, dst), dst) | 1134 | if os.path.islink(dst) or not os.path.exists(dst): |
1135 | os.symlink(relpath(src, dst), dst) | ||
1136 | else: | ||
1137 | raise GitError('cannot overwrite a local work tree') | ||
1136 | except OSError, e: | 1138 | except OSError, e: |
1137 | if e.errno == errno.EPERM: | 1139 | if e.errno == errno.EPERM: |
1138 | raise GitError('filesystem must support symlinks') | 1140 | raise GitError('filesystem must support symlinks') |