Mercurial > hg > config
annotate python/hg-tricks.py @ 767:35f8751c0930
it is very annoying to have ones overrides overridden; see also http://stackoverflow.com/questions/25381304/why-type-cd-on-mac-os-states-that-cd-is-a-function
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Thu, 28 Jan 2016 14:02:17 -0800 |
parents | 11ac996b9c49 |
children |
rev | line source |
---|---|
397
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
1 """ |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
2 random collection of hg tricks in python |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
3 """ |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
4 |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
5 # XXX STUB |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
6 |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
7 from subprocess import check_output as call |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
8 |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
9 ### check status |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
10 |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
11 def changes(hg='hg') |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
12 """check for outstanding changes""" |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
13 output = call([hg, 'st']).strip() |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
14 lines = [line for line in output.splitlines() |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
15 if not line.startswith('?')] |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
16 if lines: |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
17 print "Outstanding changes:" |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
18 print output |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
19 return True |
11ac996b9c49
make at least a pretend stub
Jeff Hammel <jhammel@mozilla.com>
parents:
311
diff
changeset
|
20 |