When a revision's parent commit is not known locally, it is added
to the sync queue. However, if multiple revisions of a change have
the same parent (which is common) a sync task will be added for
each copy. Instead, keep track of the parents of each revision
of a change and only sync each such commit once.
Change-Id: Ibe8fc80d87b338b6da9d529b1be38c7c4efb65f4
The commit and parent columns were not indexed, meaning that checking to see
if a commit's parent needed to be synced incurred a full table scan. Add
indexes so it's faster.
Change-Id: I093f8265a655a1fe2b7ba1be792b87e6d701fec1
On my terminal, opening a web browser link always produces the output
"GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed"
This is apparently a bug in mozilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=833117
However, the python webbrowser module could mask it by redirecting outputs.
In fact, it does so for some types of browsers, but apparently not xdg-open.
Create a new webbrowser subclass that redirects output and register it as
the appropriate way to use xdg-open so that the message is hidden.
Change-Id: I018673a2773a3bc21d7d7c1facccba91eafe1174
AND and OR caused a syntax error while 'and' and 'or' worked.
The debugging method at the bottom of __init__.py is intentional,
at least until there's real testing for this.
Change-Id: Ib5a5d7b47d64204f6dda36513dea8249d3bbce4e
We were only performing the '-' -> ' ' substitution needed for
keymap names when updating urwid commands. Do that for all commands.
Change-Id: I2bae39523993da12848c818e6caef259d9f9fa4a
If a file only has mode differences, but no content difference,
we do not have access through GitPython to find out the filenames.
https://github.com/gitpython-developers/GitPython/pull/266 has
been submitted to correct that, but in the mean time, display
"Unknown File" to avoid crashing.
Change-Id: Ic935f9737ae3978a7a639408c24f166c76a2c999
Story: 2000027
If a revision is a draft, we will not be able to sync it. Strangely,
the Gerrit API will still return review messages attached to that
draft (including "Foo uploaded patch set 1"). The gerrit webui doesn't
display those, so let's not bother storing/displaying them either.
The current code crashes when trying to save the message because the
revision doesn't exist.
Change-Id: I51617249c7240b199f0104c66b136922e36d6b7f
Story: 2000155
Simply adds a new -v/--verbose CLI option which configures logging at
the INFO log level. Also changes the debug logging in sync.get() to log
a non-200 HTTP return code, which fixes the Storyboard story 2000084,
where a ValueError was being raised by trying to JSON-decode a non-200
response body.
Change-Id: Ieabc606e0570ddf3d3af67bb926cad79b0e87591
Closes-story: 2000084
When in the list changes view, if you typed 'v' or 'k' to mark a change
reviewed or hidden, a full refresh of the list view's contents,
including querying the database for all new records, would occur. For
the cases when we're in the Unreviewed changes list, toggling a change
to reviewed should simply remove that change from the listbox, to avoid
doing a full refresh. Same for the hidden toggle.
Storyboard story: 2000085
Change-Id: I76bb439cd5ce386da7d160d3160f36c769a2a99f
For some of the sync tasks, the DB session context manager was holding
the Database object's thread lock for longer periods of time than was
necessary. This patch changes the sessionmaker in the Database object to
not expire objects on commit and not autoflush the session. This allows
the objects returned by a DB query to be used without running into an
UnboundExecutionError when trying to access attributes on the SQLAlchemy
models returned from a query after the session.commit() has been called.
We then modify some of the sync tasks to grab records and release the
thread lock on the DB session and then do their processing work instead
of holding the lock for the duration of the processing work.
Storyboard story: 2000086
Change-Id: Iae6d789409b88f4e3cb35ac9e4f839f8e4d79a97
Require the config file to have a permission of 0600 if it contains a
password. This way it is only readable/writeable by the user
Change-Id: I0c38a3c41125422b981ed3f799870906a0700180
Add some more detailed notes on creating per-project filters, as the
syntax is a little different from that used directly on Gerrit.
Add a second "Incoming reviews" dashboard, to match what Gerrit has.
Change-Id: I77377a14bc78ce2e932e3e1c2348766a84eb9911
When using gertty with SSL certificate validation turned off the
InsecureRequestWarning is shown on the screen on every REST
request (http://imgur.com/i18F1iO) which renders gertty pretty
useless. This changes disables the warnings when SSL certificate
validation is disabled.
Change-Id: Id6f46e85168bba599f8380b6613d8835d65661c3
The threading change broke reversing changes because the reversing
code used an iterator and the threading code expected a list. We
don't need to keep a copy of the original, so just modify the list
in place when reversing, so we end up with a list in both cases.
Change-Id: I577546b09f35829c4a91e7f2922f21ed26b50a1c
On startup, the initial update of all projects was set to high
priority. That makes sense for most of the sync tasks at startup
(upload changes, etc). But if you have left gertty to not sync
for any period of time, there could be quite a changes to sync.
With that happening at high priority, there is no way to find
a change and individually refresh it. So move the initial sync
to low priority. (Further syncs of all projects are at low
priority.)
Change-Id: I7cdffc39048ac4770bffefebe32d08371feb11be
We're treating some fields in the db as if they have a unique
constraint, but there is no actual unique constraint in the db.
If, somehow, we ended up with multiple approvals for the same
user associated with a change, then the correct values may not
be displayed in the change approval table.
Correct this by detecting when we have multiple local entries
for an approval and remove entries subsequent to the first.
The first entry will remain and either be removed or have its
value updated as necessary.
Change-Id: Ifdc6273f1d5d4e83124ec30ff454c46e3e3af2d3
If git diff detects a binary file with differences, it might add
some (currently) unparseable text to the diff. Ignore it to avoid an
error.
Change-Id: Ib4f615e2f2bd8d633657949c8732556b4a0575c6
It's January 4. Just because a change was updated 5 days ago is no
reason to be merely telling me it was updated in '2014' - that makes it
impossible for me to tell the difference between a 5-day-old change and
a 369-day-old change.
(if I'd gotten around to fixing this on Jan 1 when it first bugged me, I
would have been talking about changes that were mere second old being
lumped in with changes almost a year old)
For changes performed today, the Updated column will show the time of
day. For older changes, this change changes the date presentation for
all dates in the Updated column to be ISO-8601 date format, following
the recommendations in that most canonical of sources,
http://xkcd.com/1179/
Change-Id: I4702ff5f226a3eb0cdeb258856686e6e0eaef41d
When colorizing the votes on the change list, look up the category
min and max values to use the stronger versions of those colors
only if the min or max values are present.
Change-Id: I37525f0d9cda09b644a4a9dac5266cb6d56ca346
The list of changes for a given project has two columns showing the max
vote for each change. Apply the min/max color on the votes, which with
the default pallette yields red for negative scores and green for
positive ones.
The palette has supports for slightly different color when the vote is
not the maximum allowed. Unfortunately the Gerrit API does not seem to
expose the label scores available to a project which make it impossible
to finely tune the color. Assuming the color of the max/min scores will
work fine for most users.
Change-Id: I9f42be4cf41466a3500dcd98f7ad1cb6187b62a9
Use the dependency information of the most recent revisions to
create a threaded view of changes.
Also, use a more efficient query to collect the children of a
change in the change view.
Change-Id: I1cbef9fe7c4f1822b8541e5b4d0e7d2fe2e180a9
* gertty/gitrepo.py(CommitContext.decorateMessage): A regression was
introduced by 3e23dba where some platforms already used unicode for
the author.email and committer.email values. In those circumstances
attempting to decode from UTF-8 fails spectacularly, so now we only
decode when we need to.
Change-Id: I267a4cb7ff35a8c864a7f3396abd5bf44ecd1ffc
The logic on this line seems to have been reversed - it would only
un-set the reviewed flag if the reviewed flag was not set.
This change should have the effect of un-setting the reviewed flag when
a new message or commit is detected.
Change-Id: I87dc627d4e55e994ae55615d13177d83c9b277d4
Make negation left-associative, so that it groups from the left.
This seems to match what Gerrit does. This means that:
not owner:self project:foo
is:
(not owner:self) and (project:foo)
rather than the previous, erroneous behavior:
not (owner:self and project:foo)
Change-Id: I9a922fb16d0b0e0c3d17871dc0e74f2211e36399