-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhgkwinit.cmd
53 lines (49 loc) · 1.18 KB
/
hgkwinit.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@echo off
setlocal
pushd "%~dp0"
hg kwdemo 2>nul > nul
if %errorlevel% neq 0 goto :nohgkwext
if not exist .hg goto :norepo
ver > nul
if exist .hg\hgrc findstr keywordmaps .hg\hgrc > nul
if errorlevel 1 (
call :addkws ^
&& echo keyword expansion configured ^
&& echo don't forget to `hg kwexpand`
) else (
echo keywords appear already configured
echo don't forget to `hg kwexpand`
)
goto :EOF
:norepo
echo abort: no repository found in '%cd%' (.hg not found)!
exit /b 1
:nohgkwext
echo hg not installed or not found in PATH!
echo perhaps hg keyword extension is not enabled; see:
echo http://mercurial.selenic.com/wiki/KeywordExtension
exit /b 1
:addkws
setlocal
call :hgrckw >> .hg\hgrc
goto :EOF
:hgrckw
setlocal
echo.
echo [keyword]
echo src/Action.cs=
echo src/Enumerable.cs=
echo src/Enumerable.g.tt=
echo src/ExtensionAttribute.cs=
echo src/Func.cs=
echo src/IGrouping.cs=
echo src/ILookup.cs=
echo src/Internal.cs=
echo src/IOrderedEnumerable.cs=
echo src/Lookup.cs=
echo src/OrderedEnumerable.cs=
echo src/Public.cs=
echo.
echo [keywordmaps]
echo Id = {file^|basename} {node^|short} {date^|utcdate} {author^|user}
goto :EOF