pushrebase: improve error message for file conflicts

Summary:
The previous implementation relied on the python serialization of lists. This
resulted in some truncation due to line length in some infrastructure.

This patch makes it prettier.

Test Plan: Tests

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2594066

Signature: t1:2594066:1446079418:cd27cea1f44a9d432984b8dc37b547450ff076ab
This commit is contained in:
Durham Goode 2015-10-28 18:19:20 -07:00
parent a49358f7cc
commit e5a235b61a
2 changed files with 8 additions and 3 deletions

View File

@ -315,7 +315,8 @@ def _getrevs(bundle, onto):
ontomanifest = onto.manifest().matches(filematcher)
conflicts = ontomanifest.diff(commonmanifest).keys()
if conflicts:
raise util.Abort(_('conflicting changes in %r') % conflicts)
raise util.Abort(_('conflicting changes in:\n%s') %
''.join(' %s\n' % f for f in sorted(conflicts)))
return revs, oldonto

View File

@ -211,7 +211,9 @@ Stack with conflict in tail should abort
$ hg push --to default
pushing to ssh://user@dummy/server
searching for changes
abort: conflicting changes in ['a']
abort: conflicting changes in:
a
[255]
$ hg strip 5
@ -242,7 +244,9 @@ Stack with conflict in head should abort
$ hg push --to default
pushing to ssh://user@dummy/server
searching for changes
abort: conflicting changes in ['a']
abort: conflicting changes in:
a
[255]
$ hg strip 5