hg-reset.py: Print details for changed branches only

It doesn't make sense to suggest resetting branch HEADs to their current
value.

Signed-off-by: Rocco Rutte <pdmef@gmx.net>
This commit is contained in:
Rocco Rutte
2007-03-19 09:27:37 +00:00
parent 8b0fca64da
commit 5cc155e367
3 changed files with 29 additions and 19 deletions

View File

@@ -76,3 +76,12 @@ def save_cache(filename,cache):
f=open(filename,'w+')
map(lambda x: f.write(':%s %s\n' % (str(x),str(cache.get(x)))),cache.keys())
f.close()
def get_git_sha1(name,type='heads'):
try:
f=open(os.getenv('GIT_DIR','/dev/null')+'/refs/'+type+'/'+name)
sha1=f.readlines()[0].split('\n')[0]
f.close()
return sha1
except IOError:
return None