D2253: releasenotes: mention changeset with warning and abort

2018-03-07 Thread rishabhmadan96 (Rishabh Madan)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3fff6f30bd7f: releasenotes: mention changeset with warning 
and abort (authored by rishabhmadan96, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2253?vs=6591=6693

REVISION DETAIL
  https://phab.mercurial-scm.org/D2253

AFFECTED FILES
  hgext/releasenotes.py
  tests/test-releasenotes-parsing.t

CHANGE DETAILS

diff --git a/tests/test-releasenotes-parsing.t 
b/tests/test-releasenotes-parsing.t
--- a/tests/test-releasenotes-parsing.t
+++ b/tests/test-releasenotes-parsing.t
@@ -193,7 +193,7 @@
   > EOF
 
   $ hg releasenote -r .
-  unexpected block in release notes directive feature
+  changeset a4251905c440: unexpected block in release notes directive feature
   New Features
   
   
diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -311,8 +311,8 @@
 title = block['lines'][0].strip() if block['lines'] else None
 
 if i + 1 == len(blocks):
-raise error.Abort(_('release notes directive %s lacks content')
-  % directive)
+raise error.Abort(_('changeset %s: release notes directive %s '
+'lacks content') % (ctx, directive))
 
 # Now search ahead and find all paragraphs attached to this
 # admonition.
@@ -325,8 +325,8 @@
 continue
 
 if pblock['type'] != 'paragraph':
-repo.ui.warn(_('unexpected block in release notes '
-'directive %s\n') % directive)
+repo.ui.warn(_('changeset %s: unexpected block in release '
+'notes directive %s\n') % (ctx, directive))
 
 if pblock['indent'] > 0:
 paragraphs.append(pblock['lines'])



To: rishabhmadan96, #hg-reviewers, durin42
Cc: av6, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2253: releasenotes: mention changeset with warning and abort

2018-03-04 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 updated this revision to Diff 6591.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2253?vs=5693=6591

REVISION DETAIL
  https://phab.mercurial-scm.org/D2253

AFFECTED FILES
  hgext/releasenotes.py
  tests/test-releasenotes-parsing.t

CHANGE DETAILS

diff --git a/tests/test-releasenotes-parsing.t 
b/tests/test-releasenotes-parsing.t
--- a/tests/test-releasenotes-parsing.t
+++ b/tests/test-releasenotes-parsing.t
@@ -193,7 +193,7 @@
   > EOF
 
   $ hg releasenote -r .
-  unexpected block in release notes directive feature
+  changeset a4251905c440: unexpected block in release notes directive feature
   New Features
   
   
diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -311,8 +311,8 @@
 title = block['lines'][0].strip() if block['lines'] else None
 
 if i + 1 == len(blocks):
-raise error.Abort(_('release notes directive %s lacks content')
-  % directive)
+raise error.Abort(_('changeset %s: release notes directive %s '
+'lacks content') % (ctx, directive))
 
 # Now search ahead and find all paragraphs attached to this
 # admonition.
@@ -325,8 +325,8 @@
 continue
 
 if pblock['type'] != 'paragraph':
-repo.ui.warn(_('unexpected block in release notes '
-'directive %s\n') % directive)
+repo.ui.warn(_('changeset %s: unexpected block in release '
+'notes directive %s\n') % (ctx, directive))
 
 if pblock['indent'] > 0:
 paragraphs.append(pblock['lines'])



To: rishabhmadan96, #hg-reviewers
Cc: av6, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2253: releasenotes: mention changeset with warning and abort

2018-02-14 Thread pulkit (Pulkit Goyal)
pulkit added inline comments.

INLINE COMMENTS

> av6 wrote in releasenotes.py:315
> or `ctx.hex()`

That's also okay. `str(ctx) = ctx.hex()[:12]`

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2253

To: rishabhmadan96, #hg-reviewers
Cc: av6, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2253: releasenotes: mention changeset with warning and abort

2018-02-14 Thread av6 (Anton Shestakov)
av6 added inline comments.

INLINE COMMENTS

> pulkit wrote in releasenotes.py:315
> No need for `node.hex(ctx.node())`, just use ctx.

or `ctx.hex()`

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2253

To: rishabhmadan96, #hg-reviewers
Cc: av6, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2253: releasenotes: mention changeset with warning and abort

2018-02-14 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  I think ordering on the patches here is wrong. 
https://phab.mercurial-scm.org/D2255 seems to be parent of this one. Also can 
you add related tests?

INLINE COMMENTS

> releasenotes.py:315
> +raise error.Abort(_('changeset %s: release notes directive 
> %s '
> +'lacks content') % (node.hex(ctx.node()), directive))
>  

No need for `node.hex(ctx.node())`, just use ctx.

> releasenotes.py:329
> +repo.ui.warn(_('changeset %s: unexpected block in 
> release '
> +'notes directive %s\n') % (node.hex(ctx.node()), 
> directive))
>  

Same as above.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2253

To: rishabhmadan96, #hg-reviewers
Cc: pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2253: releasenotes: mention changeset with warning and abort

2018-02-13 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Output the changeset hash with the warning/abort message just to know where 
things messed up.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2253

AFFECTED FILES
  hgext/releasenotes.py

CHANGE DETAILS

diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -311,8 +311,8 @@
 title = block['lines'][0].strip() if block['lines'] else None
 
 if i + 1 == len(blocks):
-raise error.Abort(_('release notes directive %s lacks content')
-  % directive)
+raise error.Abort(_('changeset %s: release notes directive %s '
+'lacks content') % (node.hex(ctx.node()), directive))
 
 # Now search ahead and find all paragraphs attached to this
 # admonition.
@@ -325,8 +325,8 @@
 continue
 
 if pblock['type'] != 'paragraph':
-repo.ui.warn(_('unexpected block in release notes '
-'directive %s\n') % directive)
+repo.ui.warn(_('changeset %s: unexpected block in release '
+'notes directive %s\n') % (node.hex(ctx.node()), 
directive))
 
 if pblock['indent'] > 0:
 paragraphs.append(pblock['lines'])



To: rishabhmadan96, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel