@@ -800,25 +800,26 @@ def update(self, remote=None):
800
800
.. note:: Automatically creates the local repository on the first run.
801
801
"""
802
802
remote = remote or self .remote
803
+ update_limit = int (os .environ .get (UPDATE_VARIABLE , '0' ))
803
804
if not remote :
804
- # If there is no remote configured, there's nothing we can do!
805
- return
806
- if self .create (remote = remote ):
805
+ # If there's no remote there's nothing we can do!
806
+ logger . debug ( "Skipping update (pull) because there's no remote." )
807
+ elif self .create (remote = remote ):
807
808
# If the local clone didn't exist yet and we just created it,
808
809
# we can skip the update (since there's no point).
809
- return
810
- global_last_update = int (os .environ .get (UPDATE_VARIABLE , '0' ))
811
- if global_last_update and self .last_updated >= global_last_update :
810
+ logger .debug ("Skipping update (pull) because local repository was just created." )
811
+ elif update_limit and self .last_updated >= update_limit :
812
812
# If an update limit has been enforced we also skip the update.
813
- return
814
- logger .info ("Pulling %s updates from %s into %s .." , self .friendly_name , remote , self .local )
815
- execute (self .get_command (
816
- method_name = 'update' ,
817
- attribute_name = 'update_command' ,
818
- local = self .local ,
819
- remote = remote ,
820
- ))
821
- self .mark_updated ()
813
+ logger .debug ("Skipping update (pull) due to update limit." )
814
+ else :
815
+ logger .info ("Pulling %s updates from %s into %s .." , self .friendly_name , remote , self .local )
816
+ execute (self .get_command (
817
+ method_name = 'update' ,
818
+ attribute_name = 'update_command' ,
819
+ local = self .local ,
820
+ remote = remote ,
821
+ ))
822
+ self .mark_updated ()
822
823
823
824
def checkout (self , revision = None , clean = False ):
824
825
"""
0 commit comments