D7594: status: add template/json data about whether a file has unresolved conflicts
rdamazio created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D7594 AFFECTED FILES mercurial/cmdutil.py mercurial/commands.py tests/test-conflict.t CHANGE DETAILS diff --git a/tests/test-conflict.t b/tests/test-conflict.t --- a/tests/test-conflict.t +++ b/tests/test-conflict.t @@ -64,7 +64,8 @@ [ { "path": "a", -"status": "M" +"status": "M", +"unresolved": true }, { "path": "a.orig", diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6893,6 +6893,8 @@ (b' %s' + end) % uipathfn(copy[f]), label=b'status.copied', ) +if morestatus: +morestatus.formatfile(f, fm) if morestatus: morestatus.formatfooter(fm) diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -788,6 +788,10 @@ unresolvedpaths = attr.ib() _label = b'status.morestatus' +def formatfile(self, path, fm): +if self.inmergestate and path in self.unresolvedpaths: +fm.data(unresolved=True) + def formatfooter(self, fm): statemsg = _(b'The repository is in an unfinished *%s* state.' ) % self.unfinishedop To: rdamazio, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7594: status: add template/json data about whether a file has unresolved conflicts
rdamazio updated this revision to Diff 18587. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7594?vs=18561&id=18587 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7594/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7594 AFFECTED FILES mercurial/cmdutil.py mercurial/commands.py tests/test-conflict.t CHANGE DETAILS diff --git a/tests/test-conflict.t b/tests/test-conflict.t --- a/tests/test-conflict.t +++ b/tests/test-conflict.t @@ -64,7 +64,8 @@ [ { "path": "a", -"status": "M" +"status": "M", +"unresolved": true }, { "path": "a.orig", diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6893,6 +6893,8 @@ (b' %s' + end) % uipathfn(copy[f]), label=b'status.copied', ) +if morestatus: +morestatus.formatfile(f, fm) if morestatus: morestatus.formatfooter(fm) diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -788,6 +788,10 @@ unresolvedpaths = attr.ib() _label = b'status.morestatus' +def formatfile(self, path, fm): +if self.inmergestate and path in self.unresolvedpaths: +fm.data(unresolved=True) + def formatfooter(self, fm): statemsg = _(b'The repository is in an unfinished *%s* state.' ) % self.unfinishedop To: rdamazio, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7594: status: add template/json data about whether a file has unresolved conflicts
Closed by commit rHG7315464f0613: status: add template/json data about whether a file has unresolved conflicts (authored by rdamazio). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7594?vs=18587&id=18606 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7594/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7594 AFFECTED FILES mercurial/cmdutil.py mercurial/commands.py tests/test-conflict.t CHANGE DETAILS diff --git a/tests/test-conflict.t b/tests/test-conflict.t --- a/tests/test-conflict.t +++ b/tests/test-conflict.t @@ -64,7 +64,8 @@ [ { "path": "a", -"status": "M" +"status": "M", +"unresolved": true }, { "path": "a.orig", diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6893,6 +6893,8 @@ (b' %s' + end) % uipathfn(copy[f]), label=b'status.copied', ) +if morestatus: +morestatus.formatfile(f, fm) if morestatus: morestatus.formatfooter(fm) diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -788,6 +788,10 @@ unresolvedpaths = attr.ib() _label = b'status.morestatus' +def formatfile(self, path, fm): +if self.inmergestate and path in self.unresolvedpaths: +fm.data(unresolved=True) + def formatfooter(self, fm): statemsg = _(b'The repository is in an unfinished *%s* state.' ) % self.unfinishedop To: rdamazio, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7594: status: add template/json data about whether a file has unresolved conflicts
martinvonz added inline comments. INLINE COMMENTS > cmdutil.py:792 > +def formatfile(self, path, fm): > +if self.inmergestate and path in self.unresolvedpaths: > +fm.data(unresolved=True) That's an O(n) lookup. Probably fine since you very rarely have thousands of conflicts... REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7594/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7594 To: rdamazio, #hg-reviewers, pulkit Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7594: status: add template/json data about whether a file has unresolved conflicts
rdamazio added inline comments. INLINE COMMENTS > martinvonz wrote in cmdutil.py:792 > That's an O(n) lookup. Probably fine since you very rarely have thousands of > conflicts... Yes, I thought of storing it as a set, but then thought that it either didn't matter or would be slower because there are so few items. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7594/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7594 To: rdamazio, #hg-reviewers, pulkit Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel