[PATCH] lib: Fix endless upgrade problem

2014-09-02 Thread Tomi Ollila
On Tue, Sep 02 2014, Austin Clements  wrote:

> 48db8c8 introduced a disagreement between when
> notmuch_database_needs_upgrade returned TRUE and when
> notmuch_database_upgrade actually performed an upgrade.  As a result,
> if a database had a version less than 3, but no new features were
> required, notmuch new would call notmuch_database_upgrade to perform
> an upgrade, but notmuch_database_upgrade would return immediately
> without updating the database version.  Hence, the next notmuch new
> would do the same, and so on.
>
> Fix this by ensuring that the upgrade-required logic is identical
> between the two.

LGTM

Tomi

> ---
>  lib/database.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 5116188..a3a7cd3 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -1222,7 +1222,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
>  target_features = notmuch->features | NOTMUCH_FEATURES_CURRENT;
>  new_features = NOTMUCH_FEATURES_CURRENT & ~notmuch->features;
>  
> -if (! new_features)
> +if (! notmuch_database_needs_upgrade (notmuch))
>   return NOTMUCH_STATUS_SUCCESS;
>  
>  if (progress_notify) {
> -- 
> 2.0.0
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] lib: Fix endless upgrade problem

2014-09-02 Thread Mark Walters

On Tue, 02 Sep 2014, Tomi Ollila  wrote:
> On Tue, Sep 02 2014, Austin Clements  wrote:
>
>> 48db8c8 introduced a disagreement between when
>> notmuch_database_needs_upgrade returned TRUE and when
>> notmuch_database_upgrade actually performed an upgrade.  As a result,
>> if a database had a version less than 3, but no new features were
>> required, notmuch new would call notmuch_database_upgrade to perform
>> an upgrade, but notmuch_database_upgrade would return immediately
>> without updating the database version.  Hence, the next notmuch new
>> would do the same, and so on.
>>
>> Fix this by ensuring that the upgrade-required logic is identical
>> between the two.
>
> LGTM

and me +1

Mark


>
> Tomi
>
>> ---
>>  lib/database.cc | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/database.cc b/lib/database.cc
>> index 5116188..a3a7cd3 100644
>> --- a/lib/database.cc
>> +++ b/lib/database.cc
>> @@ -1222,7 +1222,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
>>  target_features = notmuch->features | NOTMUCH_FEATURES_CURRENT;
>>  new_features = NOTMUCH_FEATURES_CURRENT & ~notmuch->features;
>>  
>> -if (! new_features)
>> +if (! notmuch_database_needs_upgrade (notmuch))
>>  return NOTMUCH_STATUS_SUCCESS;
>>  
>>  if (progress_notify) {
>> -- 
>> 2.0.0
>>
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] lib: Fix endless upgrade problem

2014-09-02 Thread David Bremner
Austin Clements  writes:

> 48db8c8 introduced a disagreement between when
> notmuch_database_needs_upgrade returned TRUE and when
> notmuch_database_upgrade actually performed an upgrade.  As a result,
> if a database had a version less than 3, but no new features were
> required, notmuch new would call notmuch_database_upgrade to perform
> an upgrade, but notmuch_database_upgrade would return immediately
> without updating the database version.  Hence, the next notmuch new
> would do the same, and so on.
>

Thanks for the quick fix.

pushed,

d


Re: [PATCH] lib: Fix endless upgrade problem

2014-09-02 Thread Mark Walters

On Tue, 02 Sep 2014, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Tue, Sep 02 2014, Austin Clements amdra...@mit.edu wrote:

 48db8c8 introduced a disagreement between when
 notmuch_database_needs_upgrade returned TRUE and when
 notmuch_database_upgrade actually performed an upgrade.  As a result,
 if a database had a version less than 3, but no new features were
 required, notmuch new would call notmuch_database_upgrade to perform
 an upgrade, but notmuch_database_upgrade would return immediately
 without updating the database version.  Hence, the next notmuch new
 would do the same, and so on.

 Fix this by ensuring that the upgrade-required logic is identical
 between the two.

 LGTM

and me +1

Mark



 Tomi

 ---
  lib/database.cc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/lib/database.cc b/lib/database.cc
 index 5116188..a3a7cd3 100644
 --- a/lib/database.cc
 +++ b/lib/database.cc
 @@ -1222,7 +1222,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
  target_features = notmuch-features | NOTMUCH_FEATURES_CURRENT;
  new_features = NOTMUCH_FEATURES_CURRENT  ~notmuch-features;
  
 -if (! new_features)
 +if (! notmuch_database_needs_upgrade (notmuch))
  return NOTMUCH_STATUS_SUCCESS;
  
  if (progress_notify) {
 -- 
 2.0.0

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] lib: Fix endless upgrade problem

2014-09-02 Thread David Bremner
Austin Clements amdra...@mit.edu writes:

 48db8c8 introduced a disagreement between when
 notmuch_database_needs_upgrade returned TRUE and when
 notmuch_database_upgrade actually performed an upgrade.  As a result,
 if a database had a version less than 3, but no new features were
 required, notmuch new would call notmuch_database_upgrade to perform
 an upgrade, but notmuch_database_upgrade would return immediately
 without updating the database version.  Hence, the next notmuch new
 would do the same, and so on.


Thanks for the quick fix.

pushed,

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] lib: Fix endless upgrade problem

2014-09-01 Thread Austin Clements
48db8c8 introduced a disagreement between when
notmuch_database_needs_upgrade returned TRUE and when
notmuch_database_upgrade actually performed an upgrade.  As a result,
if a database had a version less than 3, but no new features were
required, notmuch new would call notmuch_database_upgrade to perform
an upgrade, but notmuch_database_upgrade would return immediately
without updating the database version.  Hence, the next notmuch new
would do the same, and so on.

Fix this by ensuring that the upgrade-required logic is identical
between the two.
---
 lib/database.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/database.cc b/lib/database.cc
index 5116188..a3a7cd3 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1222,7 +1222,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
 target_features = notmuch->features | NOTMUCH_FEATURES_CURRENT;
 new_features = NOTMUCH_FEATURES_CURRENT & ~notmuch->features;

-if (! new_features)
+if (! notmuch_database_needs_upgrade (notmuch))
return NOTMUCH_STATUS_SUCCESS;

 if (progress_notify) {
-- 
2.0.0



[PATCH] lib: Fix endless upgrade problem

2014-09-01 Thread Austin Clements
48db8c8 introduced a disagreement between when
notmuch_database_needs_upgrade returned TRUE and when
notmuch_database_upgrade actually performed an upgrade.  As a result,
if a database had a version less than 3, but no new features were
required, notmuch new would call notmuch_database_upgrade to perform
an upgrade, but notmuch_database_upgrade would return immediately
without updating the database version.  Hence, the next notmuch new
would do the same, and so on.

Fix this by ensuring that the upgrade-required logic is identical
between the two.
---
 lib/database.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/database.cc b/lib/database.cc
index 5116188..a3a7cd3 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1222,7 +1222,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
 target_features = notmuch-features | NOTMUCH_FEATURES_CURRENT;
 new_features = NOTMUCH_FEATURES_CURRENT  ~notmuch-features;
 
-if (! new_features)
+if (! notmuch_database_needs_upgrade (notmuch))
return NOTMUCH_STATUS_SUCCESS;
 
 if (progress_notify) {
-- 
2.0.0

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] lib: Fix endless upgrade problem

2014-09-01 Thread Tomi Ollila
On Tue, Sep 02 2014, Austin Clements amdra...@mit.edu wrote:

 48db8c8 introduced a disagreement between when
 notmuch_database_needs_upgrade returned TRUE and when
 notmuch_database_upgrade actually performed an upgrade.  As a result,
 if a database had a version less than 3, but no new features were
 required, notmuch new would call notmuch_database_upgrade to perform
 an upgrade, but notmuch_database_upgrade would return immediately
 without updating the database version.  Hence, the next notmuch new
 would do the same, and so on.

 Fix this by ensuring that the upgrade-required logic is identical
 between the two.

LGTM

Tomi

 ---
  lib/database.cc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/lib/database.cc b/lib/database.cc
 index 5116188..a3a7cd3 100644
 --- a/lib/database.cc
 +++ b/lib/database.cc
 @@ -1222,7 +1222,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
  target_features = notmuch-features | NOTMUCH_FEATURES_CURRENT;
  new_features = NOTMUCH_FEATURES_CURRENT  ~notmuch-features;
  
 -if (! new_features)
 +if (! notmuch_database_needs_upgrade (notmuch))
   return NOTMUCH_STATUS_SUCCESS;
  
  if (progress_notify) {
 -- 
 2.0.0

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch