# HG changeset patch # User Chris Cannam # Date 1309348773 -3600 # Node ID 89b6ba707096746d544063674965b22597b943a3 # Parent 8506333fe65c8013c66b848e38cfbf223da82f75 Don't try to chmod on Windows; doesn't work diff -r 8506333fe65c -r 89b6ba707096 easyhg.py --- a/easyhg.py Tue Jun 28 17:03:16 2011 +0100 +++ b/easyhg.py Wed Jun 29 12:59:33 2011 +0100 @@ -13,7 +13,7 @@ # License, or (at your option) any later version. See the file # COPYING included with this distribution for more information. -import sys, os, stat, urllib, urllib2, urlparse +import sys, os, stat, urllib, urllib2, urlparse, platform from mercurial.i18n import _ from mercurial import ui, util, error @@ -98,13 +98,13 @@ except: ui.write("failed to open authfile %s for writing\n" % pfile) raise - try: - #!!! Windows equivalent? - os.fchmod(ofp.fileno(), stat.S_IRUSR | stat.S_IWUSR) - except: - ofp.close() - ui.write("failed to set permissions on authfile %s\n" % pfile) - raise + if platform.system() != 'Windows': + try: + os.fchmod(ofp.fileno(), stat.S_IRUSR | stat.S_IWUSR) + except: + ofp.close() + ui.write("failed to set permissions on authfile %s\n" % pfile) + raise pcfg.write(ofp) ofp.close()