Commits

Katsunori FUJIWARA committed 8d1f470

change eol style to unix style

Comments (0)

Files changed (3)

-syntax: glob
-
-*~
-*.pyc
+syntax: glob
+
+*~
+*.pyc
-=================================================
-exdateformat extension -- add custom date formats
-=================================================
-
-This extension allows you to add custom date formats to Mercurial.
-
-It is useful if you can not change strings to be parsed: repository
-conversion by "convert" extension, for example.
+=================================================
+exdateformat extension -- add custom date formats
+=================================================
+
+This extension allows you to add custom date formats to Mercurial.
+
+It is useful if you can not change strings to be parsed: repository
+conversion by "convert" extension, for example.
-# exdateformat.py -- add custom date formats
-#
-# Copyright (c) 2012 FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
-#
-# This software may be used and distributed according to the terms of the
-# GNU General Public License version 2 or any later version.
-
-'''add custom date formats to Mercurial.
-
-You can add custom date formats by writing 'exdateformat' section
-in your configuration file. For example::
-
-  [exdateformat]
-  one = %Y,%m,%d
-  two = %Y#%m#%d
-
-With this configuration, strings in both '%Y,%m,%d' and '%Y#%m#%d'
-formats (like as '2012#04#01') can be treated as date string in Mercurial.
-'''
-
-from mercurial import util, extensions
-
-def uisetup(ui):
-    customformats = []
-    for id, format in ui.configitems('exdateformat'):
-        customformats.append(format)
-    def parsedate(orgparsedate, date, formats=None, bias={}):
-        if not formats and not customformats:
-            # no fallback formats
-            return orgparsedate(date, formats, bias)
-
-        try:
-            # use system specific formats first
-            return orgparsedate(date, formats, bias)
-        except:
-            pass
-        if customformats:
-            # use custom formats
-            return orgparsedate(date, customformats, bias)
-        else:
-            # use default formats defined in util.py
-            return orgparsedate(date, None, bias)
-
-    extensions.wrapfunction(util, 'parsedate', parsedate)
+# exdateformat.py -- add custom date formats
+#
+# Copyright (c) 2012 FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+'''add custom date formats to Mercurial.
+
+You can add custom date formats by writing 'exdateformat' section
+in your configuration file. For example::
+
+  [exdateformat]
+  one = %Y,%m,%d
+  two = %Y#%m#%d
+
+With this configuration, strings in both '%Y,%m,%d' and '%Y#%m#%d'
+formats (like as '2012#04#01') can be treated as date string in Mercurial.
+'''
+
+from mercurial import util, extensions
+
+def uisetup(ui):
+    customformats = []
+    for id, format in ui.configitems('exdateformat'):
+        customformats.append(format)
+    def parsedate(orgparsedate, date, formats=None, bias={}):
+        if not formats and not customformats:
+            # no fallback formats
+            return orgparsedate(date, formats, bias)
+
+        try:
+            # use system specific formats first
+            return orgparsedate(date, formats, bias)
+        except:
+            pass
+        if customformats:
+            # use custom formats
+            return orgparsedate(date, customformats, bias)
+        else:
+            # use default formats defined in util.py
+            return orgparsedate(date, None, bias)
+
+    extensions.wrapfunction(util, 'parsedate', parsedate)