##// END OF EJS Templates
Remove trailing spaces, fix indentation
Thomas Arendsen Hein -
r5143:d4fa6baf default
parent child Browse files
Show More
@@ -32,7 +32,7 b' proc ::tk::MouseWheel {wFired X Y D {shi'
32 # if we are outside the app, try and scroll the focus widget
32 # if we are outside the app, try and scroll the focus widget
33 if {![winfo exists $w]} { catch {set w [focus]} }
33 if {![winfo exists $w]} { catch {set w [focus]} }
34 if {[winfo exists $w]} {
34 if {[winfo exists $w]} {
35
35
36 if {[bind $w $evt] ne ""} {
36 if {[bind $w $evt] ne ""} {
37 # Awkward ... this widget has a MouseWheel binding, but to
37 # Awkward ... this widget has a MouseWheel binding, but to
38 # trigger successfully in it, we must give it focus.
38 # trigger successfully in it, we must give it focus.
@@ -70,7 +70,7 b' proc ::tk::MouseWheel {wFired X Y D {shi'
70 bind all <MouseWheel> [list ::tk::MouseWheel %W %X %Y %D 0]
70 bind all <MouseWheel> [list ::tk::MouseWheel %W %X %Y %D 0]
71
71
72 # end of win32 section
72 # end of win32 section
73 }
73 }
74
74
75
75
76 proc gitdir {} {
76 proc gitdir {} {
@@ -326,7 +326,7 b' class filemapper(object):'
326 except KeyError, err:
326 except KeyError, err:
327 pass
327 pass
328 return '', name, ''
328 return '', name, ''
329
329
330 def __call__(self, name):
330 def __call__(self, name):
331 if self.include:
331 if self.include:
332 inc = self.lookup(name, self.include)[0]
332 inc = self.lookup(name, self.include)[0]
@@ -7,7 +7,7 b' def encodeargs(args):'
7 lines = base64.encodestring(s)
7 lines = base64.encodestring(s)
8 lines = [l.splitlines()[0] for l in lines]
8 lines = [l.splitlines()[0] for l in lines]
9 return ''.join(lines)
9 return ''.join(lines)
10
10
11 s = pickle.dumps(args)
11 s = pickle.dumps(args)
12 return encodearg(s)
12 return encodearg(s)
13
13
@@ -165,7 +165,7 b' class mercurial_source(converter_source)'
165 except TypeError:
165 except TypeError:
166 pass
166 pass
167 return copies
167 return copies
168
168
169 def getcommit(self, rev):
169 def getcommit(self, rev):
170 ctx = self.changectx(rev)
170 ctx = self.changectx(rev)
171 parents = [hex(p.node()) for p in ctx.parents() if p.node() != nullid]
171 parents = [hex(p.node()) for p in ctx.parents() if p.node() != nullid]
@@ -67,8 +67,8 b' def get_log_child(fp, url, paths, start,'
67 for k, v in orig_paths.iteritems():
67 for k, v in orig_paths.iteritems():
68 orig_paths[k] = changedpath(v)
68 orig_paths[k] = changedpath(v)
69 pickle.dump((orig_paths, revnum, author, date, message),
69 pickle.dump((orig_paths, revnum, author, date, message),
70 fp, protocol)
70 fp, protocol)
71
71
72 try:
72 try:
73 # Use an ra of our own so that our parent can consume
73 # Use an ra of our own so that our parent can consume
74 # our results without confusing the server.
74 # our results without confusing the server.
@@ -240,14 +240,14 b' class convert_svn(converter_source):'
240 break
240 break
241 raise SubversionException("child raised exception", entry)
241 raise SubversionException("child raised exception", entry)
242 yield entry
242 yield entry
243
243
244 args = [self.url, paths, start, end, limit, discover_changed_paths,
244 args = [self.url, paths, start, end, limit, discover_changed_paths,
245 strict_node_history]
245 strict_node_history]
246 arg = encodeargs(args)
246 arg = encodeargs(args)
247 hgexe = util.hgexecutable()
247 hgexe = util.hgexecutable()
248 cmd = '"%s "debugsvnlog""' % util.shellquote(hgexe)
248 cmd = '"%s "debugsvnlog""' % util.shellquote(hgexe)
249 stdin, stdout = os.popen2(cmd, 'b')
249 stdin, stdout = os.popen2(cmd, 'b')
250
250
251 stdin.write(arg)
251 stdin.write(arg)
252 stdin.close()
252 stdin.close()
253
253
@@ -540,7 +540,7 b' class convert_svn(converter_source):'
540 parents = []
540 parents = []
541 orig_paths = orig_paths.items()
541 orig_paths = orig_paths.items()
542 orig_paths.sort()
542 orig_paths.sort()
543
543
544 # check whether this revision is the start of a branch
544 # check whether this revision is the start of a branch
545 path, ent = orig_paths and orig_paths[0] or (None, None)
545 path, ent = orig_paths and orig_paths[0] or (None, None)
546 if ent and path == self.module:
546 if ent and path == self.module:
@@ -64,7 +64,7 b' def snapshot_node(ui, repo, files, node,'
64 base = os.path.join(tmproot, dirname)
64 base = os.path.join(tmproot, dirname)
65 os.mkdir(base)
65 os.mkdir(base)
66 ui.note(_('making snapshot of %d files from rev %s\n') %
66 ui.note(_('making snapshot of %d files from rev %s\n') %
67 (len(files), short(node)))
67 (len(files), short(node)))
68 for fn in files:
68 for fn in files:
69 if not fn in mf:
69 if not fn in mf:
70 # skipping new file after a merge ?
70 # skipping new file after a merge ?
@@ -90,7 +90,7 b' def snapshot_wdir(ui, repo, files, tmpro'
90 base = os.path.join(tmproot, dirname)
90 base = os.path.join(tmproot, dirname)
91 os.mkdir(base)
91 os.mkdir(base)
92 ui.note(_('making snapshot of %d files from working dir\n') %
92 ui.note(_('making snapshot of %d files from working dir\n') %
93 (len(files)))
93 (len(files)))
94 for fn in files:
94 for fn in files:
95 wfn = util.pconvert(fn)
95 wfn = util.pconvert(fn)
96 ui.note(' %s\n' % wfn)
96 ui.note(' %s\n' % wfn)
@@ -102,7 +102,7 b' def snapshot_wdir(ui, repo, files, tmpro'
102 for chunk in util.filechunkiter(repo.wopener(wfn)):
102 for chunk in util.filechunkiter(repo.wopener(wfn)):
103 fp.write(chunk)
103 fp.write(chunk)
104 return dirname
104 return dirname
105
105
106
106
107 def dodiff(ui, repo, diffcmd, diffopts, pats, opts):
107 def dodiff(ui, repo, diffcmd, diffopts, pats, opts):
108 node1, node2 = cmdutil.revpair(repo, opts['rev'])
108 node1, node2 = cmdutil.revpair(repo, opts['rev'])
@@ -133,14 +133,14 b' def dodiff(ui, repo, diffcmd, diffopts, '
133 if changes == 1 :
133 if changes == 1 :
134 if len(modified):
134 if len(modified):
135 dir1 = os.path.join(dir1, util.localpath(modified[0]))
135 dir1 = os.path.join(dir1, util.localpath(modified[0]))
136 dir2 = os.path.join(dir2root, dir2, util.localpath(modified[0]))
136 dir2 = os.path.join(dir2root, dir2, util.localpath(modified[0]))
137 elif len(removed) :
137 elif len(removed) :
138 dir1 = os.path.join(dir1, util.localpath(removed[0]))
138 dir1 = os.path.join(dir1, util.localpath(removed[0]))
139 dir2 = os.devnull
139 dir2 = os.devnull
140 else:
140 else:
141 dir1 = os.devnull
141 dir1 = os.devnull
142 dir2 = os.path.join(dir2root, dir2, util.localpath(added[0]))
142 dir2 = os.path.join(dir2root, dir2, util.localpath(added[0]))
143
143
144 cmdline = ('%s %s %s %s' %
144 cmdline = ('%s %s %s %s' %
145 (util.shellquote(diffcmd), ' '.join(diffopts),
145 (util.shellquote(diffcmd), ' '.join(diffopts),
146 util.shellquote(dir1), util.shellquote(dir2)))
146 util.shellquote(dir1), util.shellquote(dir2)))
@@ -340,7 +340,7 b' def imerge(ui, repo, *args, **opts):'
340 rev = opts.get('rev')
340 rev = opts.get('rev')
341 if rev and args:
341 if rev and args:
342 raise util.Abort('please specify just one revision')
342 raise util.Abort('please specify just one revision')
343
343
344 if len(args) == 2 and args[0] == 'load':
344 if len(args) == 2 and args[0] == 'load':
345 pass
345 pass
346 else:
346 else:
@@ -71,7 +71,7 b' class header(object):'
71 for h in self.header:
71 for h in self.header:
72 if h.startswith('index '):
72 if h.startswith('index '):
73 return True
73 return True
74
74
75 def pretty(self, fp):
75 def pretty(self, fp):
76 for h in self.header:
76 for h in self.header:
77 if h.startswith('index '):
77 if h.startswith('index '):
@@ -213,7 +213,7 b' def parsepatch(fp):'
213 'range': {'context': addcontext,
213 'range': {'context': addcontext,
214 'hunk': addhunk},
214 'hunk': addhunk},
215 }
215 }
216
216
217 p = parser()
217 p = parser()
218
218
219 state = 'context'
219 state = 'context'
@@ -311,7 +311,7 b' def record(ui, repo, *pats, **opts):'
311 for h in chunks:
311 for h in chunks:
312 try: contenders.update(dict.fromkeys(h.files()))
312 try: contenders.update(dict.fromkeys(h.files()))
313 except AttributeError: pass
313 except AttributeError: pass
314
314
315 newfiles = [f for f in files if f in contenders]
315 newfiles = [f for f in files if f in contenders]
316
316
317 if not newfiles:
317 if not newfiles:
@@ -321,7 +321,7 b' class patchfile:'
321 os.mkdir(d)
321 os.mkdir(d)
322 self.lines = []
322 self.lines = []
323 self.exists = False
323 self.exists = False
324
324
325 self.hash = {}
325 self.hash = {}
326 self.dirty = 0
326 self.dirty = 0
327 self.offset = 0
327 self.offset = 0
@@ -350,7 +350,7 b' class patchfile:'
350 vala = abs(a - linenum)
350 vala = abs(a - linenum)
351 valb = abs(b - linenum)
351 valb = abs(b - linenum)
352 return cmp(vala, valb)
352 return cmp(vala, valb)
353
353
354 try:
354 try:
355 cand = self.hash[l]
355 cand = self.hash[l]
356 except:
356 except:
@@ -706,7 +706,7 b' class hunk:'
706
706
707 def old(self, fuzz=0, toponly=False):
707 def old(self, fuzz=0, toponly=False):
708 return self.fuzzit(self.a, fuzz, toponly)
708 return self.fuzzit(self.a, fuzz, toponly)
709
709
710 def newctrl(self):
710 def newctrl(self):
711 res = []
711 res = []
712 for x in self.hunk:
712 for x in self.hunk:
@@ -842,7 +842,7 b' def applydiff(ui, fp, changed, strip=1, '
842 """reads a patch from fp and tries to apply it. The dict 'changed' is
842 """reads a patch from fp and tries to apply it. The dict 'changed' is
843 filled in with all of the filenames changed by the patch. Returns 0
843 filled in with all of the filenames changed by the patch. Returns 0
844 for a clean patch, -1 if any rejects were found and 1 if there was
844 for a clean patch, -1 if any rejects were found and 1 if there was
845 any fuzz."""
845 any fuzz."""
846
846
847 def scangitpatch(fp, firstline, cwd=None):
847 def scangitpatch(fp, firstline, cwd=None):
848 '''git patches can modify a file, then copy that file to
848 '''git patches can modify a file, then copy that file to
@@ -24,7 +24,7 b" hg ci -d '0 0' -mtest1"
24 echo b >> a
24 echo b >> a
25 hg ci -d '1 0' -mtest2
25 hg ci -d '1 0' -mtest2
26
26
27 # should diff cloned files directly
27 # should diff cloned files directly
28 hg falabala -r 0:1
28 hg falabala -r 0:1
29
29
30 # test diff during merge
30 # test diff during merge
@@ -34,7 +34,7 b' hg add c'
34 hg ci -m "new branch" -d '1 0'
34 hg ci -m "new branch" -d '1 0'
35 hg update -C 1
35 hg update -C 1
36 hg merge tip
36 hg merge tip
37 # should diff cloned file against wc file
37 # should diff cloned file against wc file
38 hg falabala > out || echo "diff-like tools yield a non-zero exit code"
38 hg falabala > out || echo "diff-like tools yield a non-zero exit code"
39 # cleanup the output since the wc is a tmp directory
39 # cleanup the output since the wc is a tmp directory
40 sed 's:\(.* \).*\(\/test-extdiff\):\1[tmp]\2:' out
40 sed 's:\(.* \).*\(\/test-extdiff\):\1[tmp]\2:' out
General Comments 0
You need to be logged in to leave comments. Login now