# HG changeset patch # User Thomas Arendsen Hein # Date 1186475323 -7200 # Node ID d4fa6bafc43aeb5423c89fdb28536f2004d3022d # Parent 2ffe3e2a1ac2625e0a7d6e62cb8f4c89760afd62 Remove trailing spaces, fix indentation diff --git a/contrib/hgk b/contrib/hgk --- a/contrib/hgk +++ b/contrib/hgk @@ -32,7 +32,7 @@ proc ::tk::MouseWheel {wFired X Y D {shi # if we are outside the app, try and scroll the focus widget if {![winfo exists $w]} { catch {set w [focus]} } if {[winfo exists $w]} { - + if {[bind $w $evt] ne ""} { # Awkward ... this widget has a MouseWheel binding, but to # trigger successfully in it, we must give it focus. @@ -70,7 +70,7 @@ proc ::tk::MouseWheel {wFired X Y D {shi bind all [list ::tk::MouseWheel %W %X %Y %D 0] # end of win32 section -} +} proc gitdir {} { diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py --- a/hgext/convert/__init__.py +++ b/hgext/convert/__init__.py @@ -326,7 +326,7 @@ class filemapper(object): except KeyError, err: pass return '', name, '' - + def __call__(self, name): if self.include: inc = self.lookup(name, self.include)[0] diff --git a/hgext/convert/common.py b/hgext/convert/common.py --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -7,7 +7,7 @@ def encodeargs(args): lines = base64.encodestring(s) lines = [l.splitlines()[0] for l in lines] return ''.join(lines) - + s = pickle.dumps(args) return encodearg(s) diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py --- a/hgext/convert/hg.py +++ b/hgext/convert/hg.py @@ -165,7 +165,7 @@ class mercurial_source(converter_source) except TypeError: pass return copies - + def getcommit(self, rev): ctx = self.changectx(rev) parents = [hex(p.node()) for p in ctx.parents() if p.node() != nullid] diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -67,8 +67,8 @@ def get_log_child(fp, url, paths, start, for k, v in orig_paths.iteritems(): orig_paths[k] = changedpath(v) pickle.dump((orig_paths, revnum, author, date, message), - fp, protocol) - + fp, protocol) + try: # Use an ra of our own so that our parent can consume # our results without confusing the server. @@ -240,14 +240,14 @@ class convert_svn(converter_source): break raise SubversionException("child raised exception", entry) yield entry - + args = [self.url, paths, start, end, limit, discover_changed_paths, strict_node_history] arg = encodeargs(args) hgexe = util.hgexecutable() cmd = '"%s "debugsvnlog""' % util.shellquote(hgexe) stdin, stdout = os.popen2(cmd, 'b') - + stdin.write(arg) stdin.close() @@ -540,7 +540,7 @@ class convert_svn(converter_source): parents = [] orig_paths = orig_paths.items() orig_paths.sort() - + # check whether this revision is the start of a branch path, ent = orig_paths and orig_paths[0] or (None, None) if ent and path == self.module: diff --git a/hgext/extdiff.py b/hgext/extdiff.py --- a/hgext/extdiff.py +++ b/hgext/extdiff.py @@ -64,7 +64,7 @@ def snapshot_node(ui, repo, files, node, base = os.path.join(tmproot, dirname) os.mkdir(base) ui.note(_('making snapshot of %d files from rev %s\n') % - (len(files), short(node))) + (len(files), short(node))) for fn in files: if not fn in mf: # skipping new file after a merge ? @@ -90,7 +90,7 @@ def snapshot_wdir(ui, repo, files, tmpro base = os.path.join(tmproot, dirname) os.mkdir(base) ui.note(_('making snapshot of %d files from working dir\n') % - (len(files))) + (len(files))) for fn in files: wfn = util.pconvert(fn) ui.note(' %s\n' % wfn) @@ -102,7 +102,7 @@ def snapshot_wdir(ui, repo, files, tmpro for chunk in util.filechunkiter(repo.wopener(wfn)): fp.write(chunk) return dirname - + def dodiff(ui, repo, diffcmd, diffopts, pats, opts): node1, node2 = cmdutil.revpair(repo, opts['rev']) @@ -133,14 +133,14 @@ def dodiff(ui, repo, diffcmd, diffopts, if changes == 1 : if len(modified): dir1 = os.path.join(dir1, util.localpath(modified[0])) - dir2 = os.path.join(dir2root, dir2, util.localpath(modified[0])) + dir2 = os.path.join(dir2root, dir2, util.localpath(modified[0])) elif len(removed) : dir1 = os.path.join(dir1, util.localpath(removed[0])) dir2 = os.devnull else: dir1 = os.devnull - dir2 = os.path.join(dir2root, dir2, util.localpath(added[0])) - + dir2 = os.path.join(dir2root, dir2, util.localpath(added[0])) + cmdline = ('%s %s %s %s' % (util.shellquote(diffcmd), ' '.join(diffopts), util.shellquote(dir1), util.shellquote(dir2))) diff --git a/hgext/imerge.py b/hgext/imerge.py --- a/hgext/imerge.py +++ b/hgext/imerge.py @@ -340,7 +340,7 @@ def imerge(ui, repo, *args, **opts): rev = opts.get('rev') if rev and args: raise util.Abort('please specify just one revision') - + if len(args) == 2 and args[0] == 'load': pass else: diff --git a/hgext/record.py b/hgext/record.py --- a/hgext/record.py +++ b/hgext/record.py @@ -71,7 +71,7 @@ class header(object): for h in self.header: if h.startswith('index '): return True - + def pretty(self, fp): for h in self.header: if h.startswith('index '): @@ -213,7 +213,7 @@ def parsepatch(fp): 'range': {'context': addcontext, 'hunk': addhunk}, } - + p = parser() state = 'context' @@ -311,7 +311,7 @@ def record(ui, repo, *pats, **opts): for h in chunks: try: contenders.update(dict.fromkeys(h.files())) except AttributeError: pass - + newfiles = [f for f in files if f in contenders] if not newfiles: diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -321,7 +321,7 @@ class patchfile: os.mkdir(d) self.lines = [] self.exists = False - + self.hash = {} self.dirty = 0 self.offset = 0 @@ -350,7 +350,7 @@ class patchfile: vala = abs(a - linenum) valb = abs(b - linenum) return cmp(vala, valb) - + try: cand = self.hash[l] except: @@ -706,7 +706,7 @@ class hunk: def old(self, fuzz=0, toponly=False): return self.fuzzit(self.a, fuzz, toponly) - + def newctrl(self): res = [] for x in self.hunk: @@ -842,7 +842,7 @@ def applydiff(ui, fp, changed, strip=1, """reads a patch from fp and tries to apply it. The dict 'changed' is filled in with all of the filenames changed by the patch. Returns 0 for a clean patch, -1 if any rejects were found and 1 if there was - any fuzz.""" + any fuzz.""" def scangitpatch(fp, firstline, cwd=None): '''git patches can modify a file, then copy that file to diff --git a/tests/test-extdiff b/tests/test-extdiff --- a/tests/test-extdiff +++ b/tests/test-extdiff @@ -24,7 +24,7 @@ hg ci -d '0 0' -mtest1 echo b >> a hg ci -d '1 0' -mtest2 -# should diff cloned files directly +# should diff cloned files directly hg falabala -r 0:1 # test diff during merge @@ -34,7 +34,7 @@ hg add c hg ci -m "new branch" -d '1 0' hg update -C 1 hg merge tip -# should diff cloned file against wc file +# should diff cloned file against wc file hg falabala > out || echo "diff-like tools yield a non-zero exit code" # cleanup the output since the wc is a tmp directory sed 's:\(.* \).*\(\/test-extdiff\):\1[tmp]\2:' out