You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bloodhound.apache.org by Joachim Dreimann <jo...@wandisco.com> on 2013/07/25 11:35:10 UTC

Re: svn commit: r1506704 - in /bloodhound/branches/bep_0008_time_series_reports: ./ bloodhound_dashboard/bhdashboard/widgets/templates/ bloodhound_theme/bhtheme/templates/ trac/ trac/trac/ticket/

Hua,

I believe Ryan mentioned before that whitespace changes add a lot of noise
to your commits, making it difficult to tell what you actually changed in
the code.

The commit below is a prime example of change noise. It touched 6
files/folders and made 28 line changes, but only 4 lines are actual code
changes.

If you feel whitespace changes are absolutely necessary, please commit them
in a separate commit that includes nothing but whitespace changes and has a
commit message clearly stating that.

Thank you.
Joe




On 24 July 2013 21:46, <hu...@apache.org> wrote:

> Author: huaxiang
> Date: Wed Jul 24 20:46:09 2013
> New Revision: 1506704
>
> URL: http://svn.apache.org/r1506704
> Log:
> Ticket #605 [BEP-0008]#2 Display historical status changes for all ticket
> order by ticket id
>
> Modified:
>     bloodhound/branches/bep_0008_time_series_reports/   (props changed)
>
> bloodhound/branches/bep_0008_time_series_reports/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
>
> bloodhound/branches/bep_0008_time_series_reports/bloodhound_theme/bhtheme/templates/bh_report_view.html
>     bloodhound/branches/bep_0008_time_series_reports/trac/   (props
> changed)
>
> bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/api.py
>
> bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/report.py
>
> Propchange: bloodhound/branches/bep_0008_time_series_reports/
>
> ------------------------------------------------------------------------------
>   Merged /bloodhound/trunk:r1505863
>
> Modified:
> bloodhound/branches/bep_0008_time_series_reports/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
> URL:
> http://svn.apache.org/viewvc/bloodhound/branches/bep_0008_time_series_reports/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html?rev=1506704&r1=1506703&r2=1506704&view=diff
>
> ==============================================================================
> ---
> bloodhound/branches/bep_0008_time_series_reports/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
> (original)
> +++
> bloodhound/branches/bep_0008_time_series_reports/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
> Wed Jul 24 20:46:09 2013
> @@ -61,7 +61,7 @@
>                  }${'__style__' in row and row.__style__+';' or None
>                  }${fullrow and 'border: none; padding: 0;' or None}">
>
> -              <td py:if="use_groups" py:choose=""
> +              <td py:if="use_groups" py:choose=""
>                    style="background: none repeat scroll 0 0 #FFFFFF;
> color: #333333;">
>                  <py:when test="idx == 0 and value_for_group and not
> fullrow">
>                    $value_for_group
> @@ -75,33 +75,33 @@
>                  <py:if test="not cell.header.hidden">
>                    <py:with vars="col = cell.header.col.strip('_')">
>                      <py:choose>
> -
> +
>                        <!--! for the report listing -->
>                        <py:when test="col == 'report'">
>                          <td class="$col" py:attrs="td_attrs">
>                            <a title="View report"
> href="${href.report(cell.value)}">{$cell.value}</a>
>                          </td>
>                        </py:when>
> -
> +
>                        <py:when test="col == 'title'">
>                          <td class="$col" py:attrs="td_attrs">
>                            <a title="View report" href="${href.report(
> row.id)}">$cell.value</a>
>                          </td>
>                        </py:when>
> -
> +
>                        <!--! for the ticket listing -->
>                        <py:when test="col in ('ticket', 'id')">
>                          <td class="ticket" py:attrs="td_attrs">
>                            <a title="View ${row.resource.realm}"
> href="$row.href">#$cell.value</a>
>                          </td>
>                        </py:when>
> -
> +
>                        <py:when test="col == 'summary' and row.id">
>                          <td class="$col" py:attrs="td_attrs">
>                            <a title="View ${row.resource.realm}"
> href="${row.href if row.href else url_of(row.resource)}">$cell.value</a>
>                          </td>
>                        </py:when>
> -
> +
>                        <!--! generic fields -->
>                        <py:when test="col == 'time'" py:with="value =
> int(cell.value) if isinstance(cell.value, basestring) else cell.value">
>                          <td class="date" py:attrs="td_attrs">${cell.value
> != '' and format_time(value) or '--'}
> @@ -113,7 +113,7 @@
>                          </td>
>                        </py:when>
>
> -                      <py:when test="col == 'datetime'" py:with="value =
> int(cell.value) if isinstance(cell.value, basestring) else cell.value">
> +                      <py:when test="col in ('datetime','tctime')"
> py:with="value = int(cell.value) if isinstance(cell.value, basestring) else
> cell.value">
>                          <td class="date" py:attrs="td_attrs">${cell.value
> != '' and format_datetime(value) or '--'}
>                          </td>
>                        </py:when>
> @@ -123,18 +123,18 @@
>                            ${wiki_to_html(context(row.resource),
> cell.value)}
>                          </td>
>                        </py:when>
> -
> +
>                        <py:when test="col == 'milestone'">
>                          <td class="$col" py:attrs="td_attrs">
>                            <a title="View milestone"
> href="${href.milestone(cell.value)}">$cell.value</a>
>                          </td>
>                        </py:when>
> -
> +
>                        <py:otherwise>
>                          <td class="$col" py:attrs="td_attrs">$cell.value
>                          </td>
>                        </py:otherwise>
> -
> +
>                      </py:choose>
>                    </py:with>
>                  </py:if>
>
> Modified:
> bloodhound/branches/bep_0008_time_series_reports/bloodhound_theme/bhtheme/templates/bh_report_view.html
> URL:
> http://svn.apache.org/viewvc/bloodhound/branches/bep_0008_time_series_reports/bloodhound_theme/bhtheme/templates/bh_report_view.html?rev=1506704&r1=1506703&r2=1506704&view=diff
>
> ==============================================================================
> ---
> bloodhound/branches/bep_0008_time_series_reports/bloodhound_theme/bhtheme/templates/bh_report_view.html
> (original)
> +++
> bloodhound/branches/bep_0008_time_series_reports/bloodhound_theme/bhtheme/templates/bh_report_view.html
> Wed Jul 24 20:46:09 2013
> @@ -35,6 +35,7 @@
>    </head>
>
>    <body>
> +
>      <div id="content" class="report row">
>        <span class='span12'><h1>$title
>          <small py:if="numrows" class="numrows">(${ngettext('%(num)s
> match', '%(num)s matches', numrows)})</small>
> @@ -44,12 +45,12 @@
>          <div py:if="description" id="description" xml:space="preserve">
>            ${wiki_to_html(context, description)}
>          </div>
> -
> +
>          <div class="buttons control-group">
>            <form py:if="'REPORT_MODIFY' in perm(report.resource)"
> action="" method="get">
>              <div>
>                <input type="hidden" name="action" value="edit" />
> -              <input type="submit" value="${_('Edit report')}"
> accesskey="e"
> +              <input type="submit" value="${_('Edit report')}"
> accesskey="e"
>                    class="btn" />
>              </div>
>            </form>
> @@ -62,7 +63,7 @@
>            <form py:if="'REPORT_DELETE' in perm(report.resource)"
> action="" method="get">
>              <div>
>                <input type="hidden" name="action" value="delete" />
> -              <input type="submit" value="${_('Delete report')}"
> +              <input type="submit" value="${_('Delete report')}"
>                    class="btn" />
>              </div>
>            </form>
> @@ -74,7 +75,7 @@
>              <div>
>                <label>
>                  Max items per page
> -                <input type="text" naime="max" size="10" value="${max}"
> +                <input type="text" naime="max" size="10" value="${max}"
>                      class="input-mini" />
>                </label>
>                <fieldset id="reportfilters" py:if="show_args_form">
>
> Propchange: bloodhound/branches/bep_0008_time_series_reports/trac/
>
> ------------------------------------------------------------------------------
>   Merged /bloodhound/trunk/trac:r1505863
>
> Modified:
> bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/api.py
> URL:
> http://svn.apache.org/viewvc/bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/api.py?rev=1506704&r1=1506703&r2=1506704&view=diff
>
> ==============================================================================
> ---
> bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/api.py
> (original)
> +++
> bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/api.py
> Wed Jul 24 20:46:09 2013
> @@ -165,13 +165,13 @@ class ITicketFieldProvider(Interface):
>          """Returns a list of select fields, each as a tuple of
>          (rank, field)
>          where field is a dictionary that defines:
> -            * name: the field name
> +            * name: the field name
>              * pk: the primary key of the field table
>              * label: the label to display, preferably wrapped with N_()
>              * cls: the model describing the field
>          the following keys can also usefully be defined:
>              * optional: a boolean specifying that the select can be empty
> -
> +
>          The rank is expected to be an integer to specify the sorting of
> the
>          select and radio fields. This is not intended to allow for the
> extent
>          of configurability of the custom fields but allows a plugin to
> mix in
> @@ -342,11 +342,11 @@ class TicketSystem(Component):
>
>          # Default select and radio fields
>          selects = []
> -        [selects.extend(field_provider.get_select_fields())
> +        [selects.extend(field_provider.get_select_fields())
>                      for field_provider in self.ticket_field_providers]
>          [select.update({'type': 'select'}) for n, select in selects]
>          radios = []
> -        [radios.extend(field_provider.get_radio_fields())
> +        [radios.extend(field_provider.get_radio_fields())
>                      for field_provider in self.ticket_field_providers]
>          [radio.update({'type': 'radio',
>                         'optional': True}) for n, radio in radios]
> @@ -379,6 +379,8 @@ class TicketSystem(Component):
>                         'label': N_('Created')})
>          fields.append({'name': 'changetime', 'type': 'time',
>                         'label': N_('Modified')})
> +        fields.append({'name':'tctime','type':'time',
> +                        'label': N_('Change Time')})
>
>          for field in self.get_custom_fields():
>              if field['name'] in [f['name'] for f in fields]:
> @@ -643,17 +645,17 @@ class TicketSystem(Component):
>      def get_select_fields(self):
>          """Default select and radio fields"""
>          from trac.ticket import model
> -        selects = [(10, {'name': 'type', 'label': N_('Type'),
> +        selects = [(10, {'name': 'type', 'label': N_('Type'),
>                           'cls': model.Type}),
> -                   (30, {'name':'priority', 'label': N_('Priority'),
> +                   (30, {'name':'priority', 'label': N_('Priority'),
>                           'cls': model.Priority}),
> -                   (40, {'name': 'milestone', 'label': N_('Milestone'),
> +                   (40, {'name': 'milestone', 'label': N_('Milestone'),
>                           'cls': model.Milestone, 'optional': True}),
> -                   (50, {'name': 'component', 'label': N_('Component'),
> +                   (50, {'name': 'component', 'label': N_('Component'),
>                           'cls': model.Component}),
> -                   (60, {'name': 'version', 'label': N_('Version'),
> +                   (60, {'name': 'version', 'label': N_('Version'),
>                           'cls': model.Version, 'optional': True}),
> -                   (70, {'name': 'severity', 'label': N_('Severity'),
> +                   (70, {'name': 'severity', 'label': N_('Severity'),
>                           'cls': model.Severity})]
>          return selects
>
> @@ -662,6 +664,6 @@ class TicketSystem(Component):
>          from trac.ticket import model
>          radios = [(20, {'name': 'status', 'label': N_('Status'),
>                          'cls': model.Status}),
> -                  (80, {'name': 'resolution', 'label': N_('Resolution'),
> +                  (80, {'name': 'resolution', 'label': N_('Resolution'),
>                          'cls': model.Resolution})]
>          return radios
>
> Modified:
> bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/report.py
> URL:
> http://svn.apache.org/viewvc/bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/report.py?rev=1506704&r1=1506703&r2=1506704&view=diff
>
> ==============================================================================
> ---
> bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/report.py
> (original)
> +++
> bloodhound/branches/bep_0008_time_series_reports/trac/trac/ticket/report.py
> Wed Jul 24 20:46:09 2013
> @@ -847,6 +847,7 @@ class ReportModule(Component):
>              'date': iso_datetime,
>              'created': iso_datetime,
>              'modified': iso_datetime,
> +                       'tctime':iso_datetime,
>          }
>
>          converters = [col_conversions.get(c.strip('_'), cell_value)
>
>
>


-- 
Joachim Dreimann | *User Experience Manager*

WANdisco // *Non-Stop Data*

e. joachim.dreimann@wandisco.com
twitter @jdreimann <https://twitter.com/jdreimann>

Re: svn commit: r1506704 - in /bloodhound/branches/bep_0008_time_series_reports: ./ bloodhound_dashboard/bhdashboard/widgets/templates/ bloodhound_theme/bhtheme/templates/ trac/ trac/trac/ticket/

Posted by Ryan Ollos <ry...@wandisco.com>.
On Fri, Jul 26, 2013 at 8:56 AM, Ryan Ollos <ry...@wandisco.com> wrote:

> On Fri, Jul 26, 2013 at 7:25 AM, Hua Xiang <hu...@gmail.com> wrote:
>
>> Hi! devs,
>>
>> Apologize for the trouble.
>> I am using PyScripter, as Joe says "PyScripter creates the changes by
>> trimming
>> trailing white spaces<
>> https://www.google.co.uk/search?q=pyscripter+trailing+spaces&oq=pyscripter+trailing+spaces&aqs=chrome.0.69i57j69i60.5419j0&sourceid=chrome&ie=UTF-8#sclient=psy-ab&q=pyscripter+trim+trailing+spaces&oq=pyscripter+trim+trailing+spaces&gs_l=serp.3...134352.134992.0.135206.5.5.0.0.0.3.215.815.0j1j3.4.0....0.0..1c.1.20.psy-ab.27nDEBjyY7Y&pbx=1&bav=on.2,or.r_qf.&bvm=bv.49784469%2Cd.cGE%2Cpv.xjs.s.en_US.MpiVkF51mpA.O&fp=79a2a23189da394e&biw=1200&bih=1825
>> >,
>> ie a space or tab at the end of lines or a space or tab in an empty line.
>> It does that the moment you open a file", whitespaces would be committed
>> with the changes.
>>
>
> You might look into whether "strip trailing whitespace on save" is an
> option that can be turned off for your editor. However, I propose that we
> should clean up our codebase and remove trailing whitespace so that we
> don't have problems like this. Let me look into that. The trac/ directory
> shouldn't have many of these problems since the codebase was cleaned up
> before the release of 1.0.1 [1].
>

I finally got around to cleaning up the whitespace in the source code in
r1566948. Please let me know if you spot any issues.

Re: svn commit: r1506704 - in /bloodhound/branches/bep_0008_time_series_reports: ./ bloodhound_dashboard/bhdashboard/widgets/templates/ bloodhound_theme/bhtheme/templates/ trac/ trac/trac/ticket/

Posted by Ryan Ollos <ry...@wandisco.com>.
On Fri, Jul 26, 2013 at 7:25 AM, Hua Xiang <hu...@gmail.com> wrote:

> Hi! devs,
>
> Apologize for the trouble.
> I am using PyScripter, as Joe says "PyScripter creates the changes by
> trimming
> trailing white spaces<
> https://www.google.co.uk/search?q=pyscripter+trailing+spaces&oq=pyscripter+trailing+spaces&aqs=chrome.0.69i57j69i60.5419j0&sourceid=chrome&ie=UTF-8#sclient=psy-ab&q=pyscripter+trim+trailing+spaces&oq=pyscripter+trim+trailing+spaces&gs_l=serp.3...134352.134992.0.135206.5.5.0.0.0.3.215.815.0j1j3.4.0....0.0..1c.1.20.psy-ab.27nDEBjyY7Y&pbx=1&bav=on.2,or.r_qf.&bvm=bv.49784469%2Cd.cGE%2Cpv.xjs.s.en_US.MpiVkF51mpA.O&fp=79a2a23189da394e&biw=1200&bih=1825
> >,
> ie a space or tab at the end of lines or a space or tab in an empty line.
> It does that the moment you open a file", whitespaces would be committed
> with the changes.
>

You might look into whether "strip trailing whitespace on save" is an
option that can be turned off for your editor. However, I propose that we
should clean up our codebase and remove trailing whitespace so that we
don't have problems like this. Let me look into that. The trac/ directory
shouldn't have many of these problems since the codebase was cleaned up
before the release of 1.0.1 [1].


> Any suggestions to avoid this happen? And, may I ask how do you generate
> codes, devs?
>

I use PyCharm and Vim.

[1] http://trac.edgewall.org/changeset/11490

Re: svn commit: r1506704 - in /bloodhound/branches/bep_0008_time_series_reports: ./ bloodhound_dashboard/bhdashboard/widgets/templates/ bloodhound_theme/bhtheme/templates/ trac/ trac/trac/ticket/

Posted by Hua Xiang <hu...@gmail.com>.
Hi! devs,

Apologize for the trouble.
I am using PyScripter, as Joe says "PyScripter creates the changes by trimming
trailing white spaces<https://www.google.co.uk/search?q=pyscripter+trailing+spaces&oq=pyscripter+trailing+spaces&aqs=chrome.0.69i57j69i60.5419j0&sourceid=chrome&ie=UTF-8#sclient=psy-ab&q=pyscripter+trim+trailing+spaces&oq=pyscripter+trim+trailing+spaces&gs_l=serp.3...134352.134992.0.135206.5.5.0.0.0.3.215.815.0j1j3.4.0....0.0..1c.1.20.psy-ab.27nDEBjyY7Y&pbx=1&bav=on.2,or.r_qf.&bvm=bv.49784469%2Cd.cGE%2Cpv.xjs.s.en_US.MpiVkF51mpA.O&fp=79a2a23189da394e&biw=1200&bih=1825>,
ie a space or tab at the end of lines or a space or tab in an empty line.
It does that the moment you open a file", whitespaces would be committed
with the changes.

Any suggestions to avoid this happen? And, may I ask how do you generate
codes, devs?


Cheers!
Hua


2013/7/25 Joachim Dreimann <jo...@wandisco.com>

> Hua,
>
> I believe Ryan mentioned before that whitespace changes add a lot of noise
> to your commits, making it difficult to tell what you actually changed in
> the code.
>
> The commit below is a prime example of change noise. It touched 6
> files/folders and made 28 line changes, but only 4 lines are actual code
> changes.
>
> If you feel whitespace changes are absolutely necessary, please commit them
> in a separate commit that includes nothing but whitespace changes and has a
> commit message clearly stating that.
>
> Thank you.
> Joe
>
>