Monday 14 December 2020

hgweb date of Mercurial

久しぶりに LLVM いじったら、brew update から始まって環境設定に2時間... 恒例の Mercurial の hgweb の date の表示の修正です。

なんで、2 weeks ago とか 2 month ago とかだすのか理解できないです。2年前以上は日付がでる。ぜんぶそうしろよ。計算できないのはアメリカ人だけだから。

hgweb.config で指定できるべきなんだろうけど。ちなみに、hg もやっと Python3 に対応したらしい。全部のファイルが10%ずつ変更なので、つらいのはわかる。
pycompat なんてのがあるのか。

  +firefly+one diff -c templatefilters.py templatefilters.py.orig 
  *** templatefilters.py Mon Dec 14 19:40:36 2020
  --- templatefilters.py.orig   Mon Dec 14 20:47:18 2020
  ***************
  *** 86,93 ****
         return b'in the distant future'
     else:
       delta = max(1, int(now - then))
  !     # if delta > agescales[0][1] * 2:
  !     if delta > agescales[3][1] :
         return dateutil.shortdate(date)
   
     for t, s, a in agescales:
  --- 86,92 ----
         return b'in the distant future'
     else:
       delta = max(1, int(now - then))
  !     if delta > agescales[0][1] * 2:
         return dateutil.shortdate(date)
   
     for t, s, a in agescales:
  +firefly+one diff -c templates/static/mercurial.js templates/static/mercurial.js.orig
  *** templates/static/mercurial.js    Mon Dec 14 18:31:49 2020
  --- templates/static/mercurial.js.orig Mon Dec 14 17:23:04 2020
  ***************
  *** 293,301 ****
                  return "in the distant future";
              }
          }
  -         if (delta > (scales.day)){
  -           return shortdate(once);
  -         }
   
          if (delta > (2 * scales.year)){
              return shortdate(once);
  --- 293,298 ----

No comments: