FishEye contains a powerful query language called EyeQL. EyeQL is an intuitive SQL-like language that allows you to write your own specific queries. See examples.
EyeQL allows you to perform complex searches either within the Advanced Search or incorporated in scripts when programming the FishEye API.
|
query: |
select revisions |
|
clauses: |
clause ((or|and|,) clause)* |
|
clause: |
(clauses)
csid = word p4:jobid = word p4:jobid =~ word reviewed (in | before | in or before) review word (in | before | in or before) any (review states)? review Notes: |
|
tag-range: |
( ( | [ ) T1:word, T2:word ( ) | ] ) Having trouble with Subversion tags? See How Tags Work in Subversion for more information. |
|
word: |
Any string, or any non-quoted word that does not contain white space or any other separators. |
|
string: |
A sequence enclosed in either |
|
dateExp: |
See our Date Expressions Reference Guide for more information on date formats. |
|
return-clauses: |
return-clause (, return-clause)* |
|
return-clause: |
( path | dir | directory | revision | author | date | comment | csid | isBinary | totalLines | linesAdded | linesRemoved | isAdded | isDeleted | isCopied | isMoved | tags | reviews | aggregate) Notes: reviews applies to Crucible reviews. |
|
aggregate-return-field: |
( count(revisions) | count(binary-field) | count(distinct other-field) | sum(numeric-field) | average(numeric-field) | max(numeric-field) | min(numeric-field) ) The aggregate field to return. Notes: binary-fields are isBinary, isAdded, isDeleted, isCopied, isMoved. e.g. count(isAdded) will return the number of added files. numeric-fields are totalLines, linesAdded, linesRemoved. other-field can be path, dir, author, date, csid, tags or reviews. e.g. count(distinct path) will return the number of unique paths. count(distinct tags) will return the number of unique tags. If a With no
With a
With a
With a
i.e. The EyeQL can contain a returns clause that contains all non-aggregate columns, or all aggregate columns. |
|
limit-clause: |
( length | offset, length | length offset offset ) Notes: Limits the number of results to return. offset specifies the starting point of the truncated result set and length specifies the set length. offset is zero-based. |
Examples
The following examples demonstrate using EyeQL to extract information from your repository.
Find files removed on the Ant 1.5 branch:
select revisions where modified on branch ANT_15_BRANCH and is dead group by changeset
As above, but just return the person and time the files were deleted:
select revisions where modified on branch ANT_15_BRANCH and is dead return path, author, date
Find files on branch and exclude delete files:
select revisions where modified on branch ANT_15_BRANCH and not is deleted group by changeset
Find changes made to Ant 1.5.x after 1.5FINAL:
select revisions where on branch ANT_15_BRANCH and after tag ANT_MAIN_15FINAL group by changeset
Find changes made between Ant 1.5 and 1.5.1:
select revisions where between tags (ANT_MAIN_15FINAL, ANT_151_FINAL] group by changeset
As above, but show the history of each file separately:
select revisions where between tags (ANT_MAIN_15FINAL, ANT_151_FINAL] group by file
Find Java files that are tagged ANT_151_FINAL and are head on the ANT_15_BRANCH: (i.e. files that haven't changed in 1.5.x since 1.5.1)
select revisions from dir /src/main where is head and tagged ANT_151_FINAL and on branch ANT_15_BRANCH and path like *.java group by changeset
Find changes made by conor to Ant 1.5.x since 1.5.0:
select revisions where between tags (ANT_MAIN_15FINAL, ANT_154] and author = conor group by changeset
Find commits that do not have comments:
select revisions from dir / where comment = "" group by changeset
Find the 10 most recent revisions:
select revisions order by date desc limit 10
Find the 5th, 6th & 7th revisions:
select revisions order by date limit 4, 3
Find commits between two dates:
select revisions where date in [2008-03-08, 2008-04-08]
Find revisions that do not have any associated review:
select revisions where (not in any review)
Return number of matched revisions, the number of files modified, authors who modified code, changesets, tags, and reviews:
As Sub-totals for each distinct changeset, Return csid, the author, date, comment, number of matched revisions, the number of files modified, the lines added/removed:
For each matched file, return the file name, number of matched revisions, the lines added/removed:
Show all the changesets with no review:







18 Comments
Hide/Show CommentsJul 30, 2009
Anonymous
I'm trying to search for the exact phrase "using(" in the code, but no matter what I try, it will not search for using(, only using. How would I do this?
May 20, 2010
Edwin Dawson [Atlassian Technical Writer]
Hi there,
This is possible by putting quotes around the desired text:
I hope this helps.
Best Regards,
–
Edwin Dawson
Technical Writing Team Leader
edawson@atlassian.com
ATLASSIAN - http://www.atlassian.com
Jun 11, 2010
Anonymous
The query which i'm using returns large number of rows(more then 2000).By making use of the limit-clause offset i want to page the results say 0,1000.Please let me know how to implement.
Jun 12, 2010
Tom Davies
You would use
limit 0, 1000(or justlimit 1000as offset defaults to zero) for the first page of 1000 results, andlimit 1000, 1000for the second page.Jun 14, 2010
Anonymous
When i query fisheye using the select revisions from dir.....where comment matches..return path,revision, author, date its working fine and getting the result as expected but when i'm trying to get the number of lines modified by updating the same uery its not working and the query used is as below..
select revisions from dir.....group by file where comment matches..return path,revision, author, date,sum(totalLines)..
plz let me know where i'm going wrong.
Sep 21, 2010
Matthew Watson [Atlassian]
sum(totalLines) is an aggregate return clause that for a
group by fileis only compatible withreturn path, sum(totalLines).Note that totalLines is the number of lines in the file, whereas linesAdded and linesRemoved is probably what you're after. Use either
select revisions from dir.....where comment matches..return path,revision, author, date, linesAdded, linesRemovedor an aggregate query likeselect revisions from dir.....where comment matches.. group by path return path, sum(linesAdded), sum(linesRemoved)orselect revisions from dir.....where comment matches.. group by csid return csid, author, date, sum(linesAdded), sum(linesRemoved)Aug 31, 2010
Anonymous
How i get changes happened for a file between two given revisions ?
Sep 21, 2010
Matthew Watson [Atlassian]
by using a date range, e.g.
select revisions where path = "..." and date in 2008-03-08, 2008-04-08Feb 03, 2012
Rob Goodyear
Sorry to hijack anon's question, but mine's related:
Is there a way to use a revision/changeset range selector? I'm trying to create a path-level diff of M/A/D file dispositions, and csid only accepts a single == style argument.
Oct 01, 2010
Anonymous
Sorry, I just could not find how to do this.Maybe somebody help me with such query: how to find commits made at night?
Dec 02, 2010
Anonymous
Hi ,
Is there a way to compare date with current date by eyeql?
I mean I want to query all revisions in recent one week.
Would you please point me how to implement that?
Thanks in advance!
Jay
Feb 01, 2011
Anonymous
is there a way to order by path? thanks!
Feb 04, 2011
Anonymous
Any way to find difference/changes between two revisions ?
Feb 04, 2011
Deepu Mathew
Any way to find difference/changes between two revisions ?
Jun 23, 2011
Anonymous
Is it possible to have
where comment matches (string1, string2, string3) ?
Aug 31, 2011
Anonymous
linesAdded and linesRemoved gives us information which also includes modified line. For example 5 lines are changed (neither added nor removed) by a developer then there is no clear indication how to calculate them. If 5 lines are changed in code, it gives us information in terms of 5 lines removed and 5 lines added. Basically I want output which gives me linesAdded (ONLY NEWLY ADDED lines but not including modified lines), linesRemoved (purely REMOVED lines but not including modified lines) and linesChanged (this doesn't exists).
Anyone has any idea how to get this information?
Sep 05, 2011
Anonymous
Is it normal that the after tag clause takes branches into account even if is head is specified?
Using
also the files modified on branches appear, even if the tag SOME_TAG was set after the branch was created or the file on the branch was modified.
Feb 02, 2012
Anonymous
I'm trying to find a list of all source files that do not contain our copyright information.
I have tried the following:
But the results all seem to contain this string.
Add Comment