Mercurial scripting with python

后端 未结 7 1068
-上瘾入骨i
-上瘾入骨i 2020-12-13 04:23

I am trying to get the mercurial revision number/id (it\'s a hash not a number) programmatically in python.

The reason is that I want to add it to the css/js files on

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 04:56

    FWIW to avoid fetching that value on every page/view render, I just have my deploy put it into the settings.py file. Then I can reference settings.REVISION without all the overhead of accessing mercurial and/or another process. Do you ever have this value change w/o reloading your server?

提交回复
热议问题