Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 417:f2d1f5fd0179
[PATCH] file type fixes for the other 'OS'
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] file type fixes for the other 'OS'
From: K Thananchayan <thananck@yahoo.com>
Filetype fixes:
All working files and files in the repository are processed as binary.
.hgignore is read as text when constructing ignorelist as this file
is intended to be edited.
manifest hash: c034cdcc54011fd3de9e32f1aa8b2b6f84e1b2b8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCuNoRywK+sNU5EO8RAjarAJ9ScUoFL1A7mpO7qorCy6okhi0nggCcDgpp
dfDl4dALGQA0PqXqtI+T5gU=
=IVxr
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Tue, 21 Jun 2005 19:25:05 -0800 |
parents | 5e9e8b8d2629 |
children | 0446f698d38e |
comparison
equal
deleted
inserted
replaced
416:5e9e8b8d2629 | 417:f2d1f5fd0179 |
---|---|
334 d = os.path.dirname(f) | 334 d = os.path.dirname(f) |
335 if not os.path.isdir(d): | 335 if not os.path.isdir(d): |
336 os.makedirs(d) | 336 os.makedirs(d) |
337 else: | 337 else: |
338 if s.st_nlink > 1: | 338 if s.st_nlink > 1: |
339 file(f + ".tmp", "w").write(file(f).read()) | 339 file(f + ".tmp", "wb").write(file(f, "rb").read()) |
340 os.rename(f+".tmp", f) | 340 os.rename(f+".tmp", f) |
341 | 341 |
342 return file(f, mode) | 342 return file(f, mode) |
343 | 343 |
344 return o | 344 return o |
384 | 384 |
385 def ignore(self, f): | 385 def ignore(self, f): |
386 if self.ignorelist is None: | 386 if self.ignorelist is None: |
387 self.ignorelist = [] | 387 self.ignorelist = [] |
388 try: | 388 try: |
389 l = self.wfile(".hgignore") | 389 l = file(self.wjoin(".hgignore")) |
390 for pat in l: | 390 for pat in l: |
391 if pat != "\n": | 391 if pat != "\n": |
392 self.ignorelist.append(re.compile(pat[:-1])) | 392 self.ignorelist.append(re.compile(pat[:-1])) |
393 except IOError: pass | 393 except IOError: pass |
394 for pat in self.ignorelist: | 394 for pat in self.ignorelist: |
567 for f in commit: | 567 for f in commit: |
568 self.ui.note(f + "\n") | 568 self.ui.note(f + "\n") |
569 try: | 569 try: |
570 fp = self.wjoin(f) | 570 fp = self.wjoin(f) |
571 mf1[f] = is_exec(fp) | 571 mf1[f] = is_exec(fp) |
572 t = file(fp).read() | 572 t = self.wopener(f).read() |
573 except IOError: | 573 except IOError: |
574 self.warn("trouble committing %s!\n" % f) | 574 self.warn("trouble committing %s!\n" % f) |
575 raise | 575 raise |
576 | 576 |
577 meta = {} | 577 meta = {} |
1196 """perform a 3-way merge in the working directory""" | 1196 """perform a 3-way merge in the working directory""" |
1197 | 1197 |
1198 def temp(prefix, node): | 1198 def temp(prefix, node): |
1199 pre = "%s~%s." % (os.path.basename(fn), prefix) | 1199 pre = "%s~%s." % (os.path.basename(fn), prefix) |
1200 (fd, name) = tempfile.mkstemp("", pre) | 1200 (fd, name) = tempfile.mkstemp("", pre) |
1201 f = os.fdopen(fd, "w") | 1201 f = os.fdopen(fd, "wb") |
1202 f.write(fl.revision(node)) | 1202 f.write(fl.revision(node)) |
1203 f.close() | 1203 f.close() |
1204 return name | 1204 return name |
1205 | 1205 |
1206 fl = self.file(fn) | 1206 fl = self.file(fn) |