Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RQL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
RQL
Commits
e31e4c6c6aae
Commit
e31e4c6c6aae
authored
16 years ago
by
Nicolas Chauvat
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: do not remove items for the list you iterate on
parent
feb5b751655d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
stmts.py
+2
-2
2 additions, 2 deletions
stmts.py
test/unittest_nodes.py
+11
-0
11 additions, 0 deletions
test/unittest_nodes.py
with
13 additions
and
2 deletions
stmts.py
+
2
−
2
View file @
e31e4c6c
...
@@ -628,7 +628,7 @@
...
@@ -628,7 +628,7 @@
self
.
undo_manager
.
add_operation
(
RemoveGroupOperation
(
vref
))
self
.
undo_manager
.
add_operation
(
RemoveGroupOperation
(
vref
))
def
remove_groups
(
self
):
def
remove_groups
(
self
):
for
vref
in
self
.
groupby
:
for
vref
in
self
.
groupby
[:]
:
self
.
remove_group_var
(
vref
)
self
.
remove_group_var
(
vref
)
def
add_sort_var
(
self
,
var
,
asc
=
True
):
def
add_sort_var
(
self
,
var
,
asc
=
True
):
...
@@ -656,7 +656,7 @@
...
@@ -656,7 +656,7 @@
def
remove_sort_terms
(
self
):
def
remove_sort_terms
(
self
):
if
self
.
orderby
:
if
self
.
orderby
:
for
term
in
self
.
orderby
:
for
term
in
self
.
orderby
[:]
:
self
.
remove_sort_term
(
term
)
self
.
remove_sort_term
(
term
)
def
remove_sort_term
(
self
,
term
):
def
remove_sort_term
(
self
,
term
):
...
...
This diff is collapsed.
Click to expand it.
test/unittest_nodes.py
+
11
−
0
View file @
e31e4c6c
...
@@ -143,6 +143,17 @@
...
@@ -143,6 +143,17 @@
tree
.
recover
()
tree
.
recover
()
tree
.
check_references
()
tree
.
check_references
()
self
.
assertEquals
(
tree
.
as_string
(),
'
Any X GROUPBY X
'
)
self
.
assertEquals
(
tree
.
as_string
(),
'
Any X GROUPBY X
'
)
def
test_select_remove_groups
(
self
):
tree
=
self
.
_parse
(
'
Any X,Y GROUPBY X,Y
'
)
tree
.
save_state
()
select
=
tree
.
children
[
0
]
select
.
remove_groups
()
tree
.
check_references
()
self
.
assertEquals
(
tree
.
as_string
(),
'
Any X,Y
'
)
tree
.
recover
()
tree
.
check_references
()
self
.
assertEquals
(
tree
.
as_string
(),
'
Any X,Y GROUPBY X,Y
'
)
def
test_select_base_1
(
self
):
def
test_select_base_1
(
self
):
tree
=
self
.
_parse
(
"
Any X WHERE X is Person
"
)
tree
=
self
.
_parse
(
"
Any X WHERE X is Person
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment