7dcf1302df1abed662c1eb4ef504e00b4a40dee1 braney Mon Dec 17 14:09:00 2012 -0800 re-try a hub with an error message after a hg.conf configurable amount of time has passed (#9666) diff --git src/lib/common.c src/lib/common.c index b253d92..b0dd20f 100644 --- src/lib/common.c +++ src/lib/common.c @@ -3360,30 +3360,38 @@ struct tm storage={0,0,0,0,0,0,0,0,0}; if (strptime(date,format,&storage)==NULL) return 0; else return mktime(&storage); } boolean dateIsOld(const char *date,const char*format) // Is this string date older than now? { time_t test = dateToSeconds(date,format); time_t now = clock1(); return (test < now); } +boolean dateIsOlderBy(const char *date,const char*format, time_t seconds) +// Is this string date older than now by this many seconds? +{ +time_t test = dateToSeconds(date,format); +time_t now = clock1(); +return (test + seconds < now); +} + static int daysOfMonth(struct tm *tp) /* Returns the days of the month given the year */ { int days=0; switch(tp->tm_mon) { case 3: case 5: case 8: case 10: days = 30; break; case 1: days = 28; if ( (tp->tm_year % 4) == 0 && ((tp->tm_year % 20) != 0 || (tp->tm_year % 100) == 0) ) days = 29;