Merge with MPM.

This commit is contained in:
Bryan O'Sullivan 2005-08-24 12:50:11 -07:00
commit 22c1455510
6 changed files with 28 additions and 11 deletions

View File

@ -12,4 +12,5 @@ recursive-include contrib *
include README include README
include CONTRIBUTORS include CONTRIBUTORS
include COPYING include COPYING
include Makefile
include MANIFEST.in include MANIFEST.in

View File

@ -2,6 +2,9 @@
PYTHON=python PYTHON=python
all: all:
$(PYTHON) setup.py build_ext -i
install:
@echo "Read the file README for install instructions." @echo "Read the file README for install instructions."
clean: clean:

View File

@ -103,7 +103,7 @@ _hg()
export|manifest|update|checkout|up|co) export|manifest|update|checkout|up|co)
_hg_tags _hg_tags
;; ;;
pull|push|outgoing|incoming) pull|push|outgoing|incoming|out|in)
_hg_paths _hg_paths
COMPREPLY=(${COMPREPLY[@]:-} $( compgen -d -- "$cur" )) COMPREPLY=(${COMPREPLY[@]:-} $( compgen -d -- "$cur" ))
;; ;;
@ -113,7 +113,7 @@ _hg()
add) add)
_hg_status "u" _hg_status "u"
;; ;;
commit) commit|ci)
_hg_status "mra" _hg_status "mra"
;; ;;
remove) remove)

View File

@ -773,6 +773,14 @@ class localrepository:
def wfile(self, f, mode='r'): def wfile(self, f, mode='r'):
return self.wopener(f, mode) return self.wopener(f, mode)
def wread(self, filename):
return self.wopener(filename, 'r').read()
def wwrite(self, filename, data, fd=None):
if fd:
return fd.write(data)
return self.wopener(filename, 'w').write(data)
def transaction(self): def transaction(self):
# save dirstate for undo # save dirstate for undo
try: try:
@ -839,7 +847,7 @@ class localrepository:
linkrev = self.changelog.count() linkrev = self.changelog.count()
for f in files: for f in files:
try: try:
t = self.wfile(f).read() t = self.wread(f)
tm = util.is_exec(self.wjoin(f), mfm.get(f, False)) tm = util.is_exec(self.wjoin(f), mfm.get(f, False))
r = self.file(f) r = self.file(f)
mfm[f] = tm mfm[f] = tm
@ -932,7 +940,7 @@ class localrepository:
self.ui.note(f + "\n") self.ui.note(f + "\n")
try: try:
mf1[f] = util.is_exec(self.wjoin(f), mf1.get(f, False)) mf1[f] = util.is_exec(self.wjoin(f), mf1.get(f, False))
t = self.wfile(f).read() t = self.wread(f)
except IOError: except IOError:
self.ui.warn("trouble committing %s!\n" % f) self.ui.warn("trouble committing %s!\n" % f)
raise raise
@ -1023,7 +1031,7 @@ class localrepository:
mf2, u = None, [] mf2, u = None, []
def fcmp(fn, mf): def fcmp(fn, mf):
t1 = self.wfile(fn).read() t1 = self.wread(fn)
t2 = self.file(fn).read(mf.get(fn, nullid)) t2 = self.file(fn).read(mf.get(fn, nullid))
return cmp(t1, t2) return cmp(t1, t2)
@ -1660,7 +1668,7 @@ class localrepository:
# is the wfile new since m1, and match m2? # is the wfile new since m1, and match m2?
if f not in m1: if f not in m1:
t1 = self.wfile(f).read() t1 = self.wread(f)
t2 = self.file(f).read(m2[f]) t2 = self.file(f).read(m2[f])
if cmp(t1, t2) == 0: if cmp(t1, t2) == 0:
n = m2[f] n = m2[f]
@ -1780,10 +1788,10 @@ class localrepository:
self.ui.note("getting %s\n" % f) self.ui.note("getting %s\n" % f)
t = self.file(f).read(get[f]) t = self.file(f).read(get[f])
try: try:
self.wfile(f, "w").write(t) self.wwrite(f, t)
except IOError: except IOError:
os.makedirs(os.path.dirname(self.wjoin(f))) os.makedirs(os.path.dirname(self.wjoin(f)))
self.wfile(f, "w").write(t) self.wwrite(f, t)
util.set_exec(self.wjoin(f), mf2[f]) util.set_exec(self.wjoin(f), mf2[f])
if moddirstate: if moddirstate:
if branch_merge: if branch_merge:
@ -1836,7 +1844,7 @@ class localrepository:
pre = "%s~%s." % (os.path.basename(fn), prefix) pre = "%s~%s." % (os.path.basename(fn), prefix)
(fd, name) = tempfile.mkstemp("", pre) (fd, name) = tempfile.mkstemp("", pre)
f = os.fdopen(fd, "wb") f = os.fdopen(fd, "wb")
f.write(fl.read(node)) self.wwrite(fn, fl.read(node), f)
f.close() f.close()
return name return name

View File

@ -844,7 +844,7 @@ class hgwebdir:
except: except:
virtual = "" virtual = ""
if virtual: if virtual[1:]:
real = self.cp.get("paths", virtual[1:]) real = self.cp.get("paths", virtual[1:])
h = hgweb(real) h = hgweb(real)
h.run() h.run()
@ -875,9 +875,12 @@ class hgwebdir:
except: except:
return default return default
url = os.environ["REQUEST_URI"] + "/" + v
url = url.replace("//", "/")
yield dict(author = get("web", "author", "unknown"), yield dict(author = get("web", "author", "unknown"),
name = get("web", "name", v), name = get("web", "name", v),
url = os.environ["REQUEST_URI"] + "/" + v, url = url,
parity = parity, parity = parity,
shortdesc = get("web", "description", "unknown"), shortdesc = get("web", "description", "unknown"),
lastupdate = os.stat(os.path.join(r, ".hg", lastupdate = os.stat(os.path.join(r, ".hg",

View File

@ -142,6 +142,8 @@ options:
-r --rev -r --rev
revision revision
-a --text
treat all files as text
-I --include -I --include
include path in search include path in search
-X --exclude -X --exclude