~yasumoto7/five-a-day/icon_countdown

« back to all changes in this revision

Viewing changes to fiveaday/bzr.py

  • Committer: Daniel Holbach
  • Date: 2008-06-23 08:45:43 UTC
  • Revision ID: daniel.holbach@canonical.com-20080623084543-66rb3ygb6gx0f10t
commit locally if last commit was within the last 60 minutes (as opposed to last 10 commits)

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
 
100
100
    # check if committed already in the last hour:
101
101
    if not force:
102
 
        b = branch.Branch.open(files.local_branch())
103
 
        when_push = 10-(b.revno() % 10)
104
 
        if when_push != 10:
105
 
            print >> sys.stdout, _("Bugs have been added, but will be pushed in %d commits.") % when_push
106
 
            return 0 # This is no error 
 
102
        b = branch.Branch.open("http://"+remote_branch().split("@")[1])
 
103
        last_rev = b.last_revision()
 
104
        if last_rev:
 
105
            last_rev = b.repository.get_revision(last_rev)
 
106
            seconds_since_last_commit = time.time() - last_rev.timestamp
 
107
            if seconds_since_last_commit < 3600:
 
108
                print >> sys.stdout, _("Bugs have been added, but not committed yet (already committed %d minutes ago).") % (seconds_since_last_commit/60)
 
109
                return 0 # This is no error 
107
110
 
108
111
    err = update_branch()
109
112
    if err: