diff options
author | Rob Ward <robert.ward114@googlemail.com> | 2014-02-02 11:42:05 +0000 |
---|---|---|
committer | Rob Ward <robert.ward114@googlemail.com> | 2014-02-11 18:19:04 +0000 |
commit | 1829101e285cf7956d045cf7a04a8adb7f4c0109 (patch) | |
tree | ab68a895f67489ee207b4cb340f7010d75c34bb0 /subcmds | |
parent | 1966133f8e82971f2e247a8579735a3b2f19301d (diff) | |
download | git-repo-1829101e285cf7956d045cf7a04a8adb7f4c0109.tar.gz |
Add error message for download -c conflicts
Currently if you run repo download -c on a change and the cherry-pick
runs into a merge conflict a Traceback is produced:
rob@rob-i5-lm ~/Programming/repo_test/repo1 $ repo download -c repo1 3/1
From ssh://rob-i5-lm:29418/repo1
* branch refs/changes/03/3/1 -> FETCH_HEAD
error: could not apply 0c8b474... 2
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
Traceback (most recent call last):
File "/home/rob/Programming/git-repo/main.py", line 408, in <module>
_Main(sys.argv[1:])
File "/home/rob/Programming/git-repo/main.py", line 384, in _Main
result = repo._Run(argv) or 0
File "/home/rob/Programming/git-repo/main.py", line 143, in _Run
result = cmd.Execute(copts, cargs)
File "/home/rob/Programming/git-repo/subcmds/download.py", line 90, in Execute
project._CherryPick(dl.commit)
File "/home/rob/Programming/git-repo/project.py", line 1943, in _CherryPick
raise GitError('%s cherry-pick %s ' % (self.name, rev))
error.GitError: repo1 cherry-pick 0c8b4740f876f8f8372bbaed430f02b6ba8b1898
This amount of error message is confusing to users and has the side effect
of the git message telling you the actual issue being ignored.
This change introduces a message stating that the cherry-pick couldn't
be completed removing the Traceback.
To reproduce the issue create a change that causes a conflict with one currently
in review and use repo download -c to cherry-pick the conflicting change.
Change-Id: I8ddf4e0c8ad9bd04b1af5360313f67cc053f7d6a
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/download.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/subcmds/download.py b/subcmds/download.py index 471e88b5..098d8b43 100644 --- a/subcmds/download.py +++ b/subcmds/download.py | |||
@@ -18,6 +18,7 @@ import re | |||
18 | import sys | 18 | import sys |
19 | 19 | ||
20 | from command import Command | 20 | from command import Command |
21 | from error import GitError | ||
21 | 22 | ||
22 | CHANGE_RE = re.compile(r'^([1-9][0-9]*)(?:[/\.-]([1-9][0-9]*))?$') | 23 | CHANGE_RE = re.compile(r'^([1-9][0-9]*)(?:[/\.-]([1-9][0-9]*))?$') |
23 | 24 | ||
@@ -87,7 +88,12 @@ makes it available in your project's local working directory. | |||
87 | for c in dl.commits: | 88 | for c in dl.commits: |
88 | print(' %s' % (c), file=sys.stderr) | 89 | print(' %s' % (c), file=sys.stderr) |
89 | if opt.cherrypick: | 90 | if opt.cherrypick: |
90 | project._CherryPick(dl.commit) | 91 | try: |
92 | project._CherryPick(dl.commit) | ||
93 | except GitError: | ||
94 | print('[%s] Could not complete the cherry-pick of %s' \ | ||
95 | % (project.name, dl.commit), file=sys.stderr) | ||
96 | |||
91 | elif opt.revert: | 97 | elif opt.revert: |
92 | project._Revert(dl.commit) | 98 | project._Revert(dl.commit) |
93 | elif opt.ffonly: | 99 | elif opt.ffonly: |