Patchwork [6,of,6,topic-experiment] topic: don't abort if there is no current topic in stack() revset

login
register
mail settings
Submitter Pulkit Goyal
Date June 28, 2017, 9:08 p.m.
Message ID <34c0f9ca9a0ffe9196b2.1498684108@workspace>
Download mbox | patch
Permalink /patch/21812/
State Accepted
Headers show

Comments

Pulkit Goyal - June 28, 2017, 9:08 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498683069 -19800
#      Thu Jun 29 02:21:09 2017 +0530
# Node ID 34c0f9ca9a0ffe9196b2231e3df404054942941c
# Parent  25bdd52e3c2a7c0acd925b241fb14b04ac3ceacf
# EXP-Topic resolvetopic
topic: don't abort if there is no current topic in stack() revset

Named branches support has been added and we should not abort if there is no
active topic.
Pierre-Yves David - June 29, 2017, 2:25 p.m.
On 06/28/2017 11:08 PM, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1498683069 -19800
> #      Thu Jun 29 02:21:09 2017 +0530
> # Node ID 34c0f9ca9a0ffe9196b2231e3df404054942941c
> # Parent  25bdd52e3c2a7c0acd925b241fb14b04ac3ceacf
> # EXP-Topic resolvetopic
> topic: don't abort if there is no current topic in stack() revset
> 
> Named branches support has been added and we should not abort if there is no
> active topic.

I've pushed these, thanks.

I had to clean up some import  for that last one. do  you have the 
flake8 test running on your side ?

Cheers,

Patch

diff --git a/hgext3rd/topic/revset.py b/hgext3rd/topic/revset.py
--- a/hgext3rd/topic/revset.py
+++ b/hgext3rd/topic/revset.py
@@ -74,9 +74,6 @@ 
     err = 'stack() takes no argument, it works on current topic'
     revset.getargs(x, 0, 0, err)
     topic = repo.currenttopic
-    if not topic:
-        raise error.Abort(_('no active topic to list'))
-    # ordering hack, boo
     topic = None
     branch = None
     if not topic and repo.currenttopic:
diff --git a/tests/test-stack-branch.t b/tests/test-stack-branch.t
--- a/tests/test-stack-branch.t
+++ b/tests/test-stack-branch.t
@@ -139,8 +139,10 @@ 
 Also test the revset:
 
   $ hg log -r 'stack()'
-  abort: no active topic to list
-  [255]
+  2 foo {} draft c_c
+  7 foo {} draft c_d
+  4 foo {} draft c_e
+  5 foo {} draft c_f
 
 Case with multiple heads on the topic
 -------------------------------------