# HG changeset patch # User Benoit Boissinot # Date 1205526969 -3600 # Node ID f295206ae1f91a0873515c8bea9aed91451e9600 # Parent d60aa0308b02897e5e411471e7c0a190259c4af8# Parent c24f4b3f156b3bade1c402018d330c1faf719840 merge with crew diff -r d60aa0308b02 -r f295206ae1f9 hgext/win32text.py --- a/hgext/win32text.py Fri Mar 14 21:35:49 2008 +0100 +++ b/hgext/win32text.py Fri Mar 14 21:36:09 2008 +0100 @@ -22,6 +22,7 @@ # [hooks] # pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf +from mercurial import util from mercurial.i18n import gettext as _ from mercurial.node import bin, short import re @@ -46,19 +47,15 @@ def dumbencode(s, cmd): return s.replace('\r\n', '\n') -def clevertest(s, cmd): - if '\0' in s: return False - return True - def cleverdecode(s, cmd, **kwargs): - if clevertest(s, cmd): - return dumbdecode(s, cmd, **kwargs) - return s + if util.binary(s): + return s + return dumbdecode(s, cmd, **kwargs) def cleverencode(s, cmd): - if clevertest(s, cmd): - return dumbencode(s, cmd) - return s + if util.binary(s): + return s + return dumbencode(s, cmd) _filters = { 'dumbdecode:': dumbdecode, @@ -75,7 +72,7 @@ if f not in c: continue data = c[f].data() - if '\0' not in data and '\r\n' in data: + if not util.binary(data) and '\r\n' in data: if not halt: ui.warn(_('Attempt to commit or push text file(s) ' 'using CRLF line endings\n')) diff -r d60aa0308b02 -r f295206ae1f9 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Fri Mar 14 21:35:49 2008 +0100 +++ b/mercurial/cmdutil.py Fri Mar 14 21:36:09 2008 +0100 @@ -470,7 +470,7 @@ if len(pats) == 1: raise util.Abort(_('no destination specified')) dest = pats.pop() - destdirexists = os.path.isdir(dest) + destdirexists = os.path.isdir(dest) and not os.path.islink(dest) if not destdirexists: if len(pats) > 1 or util.patkind(pats[0], None)[0]: raise util.Abort(_('with multiple sources, destination must be an ' diff -r d60aa0308b02 -r f295206ae1f9 mercurial/commands.py --- a/mercurial/commands.py Fri Mar 14 21:35:49 2008 +0100 +++ b/mercurial/commands.py Fri Mar 14 21:36:09 2008 +0100 @@ -574,15 +574,17 @@ if len(args) == 3: index, rev1, rev2 = args r = revlog.revlog(util.opener(os.getcwd(), audit=False), index) + lookup = r.lookup elif len(args) == 2: if not repo: raise util.Abort(_("There is no Mercurial repository here " "(.hg not found)")) rev1, rev2 = args r = repo.changelog + lookup = repo.lookup else: raise util.Abort(_('either two or three arguments required')) - a = r.ancestor(r.lookup(rev1), r.lookup(rev2)) + a = r.ancestor(lookup(rev1), lookup(rev2)) ui.write("%d:%s\n" % (r.rev(a), hex(a))) def debugcomplete(ui, cmd='', **opts): diff -r d60aa0308b02 -r f295206ae1f9 mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Mar 14 21:35:49 2008 +0100 +++ b/mercurial/dirstate.py Fri Mar 14 21:36:09 2008 +0100 @@ -63,6 +63,9 @@ elif name == '_slash': self._slash = self._ui.configbool('ui', 'slash') and os.sep != '/' return self._slash + elif name == '_checkexec': + self._checkexec = util.checkexec(self._root) + return self._checkexec else: raise AttributeError, name @@ -578,8 +581,9 @@ if type_ == 'n': if not st: st = lstat(_join(fn)) - if (size >= 0 and (size != st.st_size - or (mode ^ st.st_mode) & 0100) + if (size >= 0 and + (size != st.st_size + or ((mode ^ st.st_mode) & 0100 and self._checkexec)) or size == -2 or fn in self._copymap): madd(fn) diff -r d60aa0308b02 -r f295206ae1f9 mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Fri Mar 14 21:35:49 2008 +0100 +++ b/mercurial/hgweb/hgweb_mod.py Fri Mar 14 21:36:09 2008 +0100 @@ -367,6 +367,20 @@ branches.append({"name": branch}) return branches + def nodeinbranch(self, ctx): + branches = [] + branch = ctx.branch() + if branch != 'default' and self.repo.branchtags().get(branch) != ctx.node(): + branches.append({"name": branch}) + return branches + + def nodebranchnodefault(self, ctx): + branches = [] + branch = ctx.branch() + if branch != 'default': + branches.append({"name": branch}) + return branches + def showtag(self, tmpl, t1, node=nullid, **args): for t in self.repo.nodetags(node): yield tmpl(t1, tag=t, **args) @@ -458,6 +472,7 @@ "rev": i, "node": hex(n), "tags": self.nodetagsdict(n), + "inbranch": self.nodeinbranch(ctx), "branches": self.nodebranchdict(ctx)}) if limit > 0: @@ -529,6 +544,7 @@ rev=ctx.rev(), node=hex(n), tags=self.nodetagsdict(n), + inbranch=self.nodeinbranch(ctx), branches=self.nodebranchdict(ctx)) if count >= self.maxchanges: @@ -572,6 +588,8 @@ files=files, archives=self.archivelist(hex(n)), tags=self.nodetagsdict(n), + branch=self.nodebranchnodefault(ctx), + inbranch=self.nodeinbranch(ctx), branches=self.nodebranchdict(ctx)) def filelog(self, tmpl, fctx): @@ -642,6 +660,7 @@ author=fctx.user(), date=fctx.date(), desc=fctx.description(), + branch=self.nodebranchnodefault(fctx), parent=self.siblings(fctx.parents()), child=self.siblings(fctx.children()), rename=self.renamelink(fl, n), @@ -689,6 +708,7 @@ date=fctx.date(), desc=fctx.description(), rename=self.renamelink(fl, n), + branch=self.nodebranchnodefault(fctx), parent=self.siblings(fctx.parents()), child=self.siblings(fctx.children()), permissions=fctx.manifest().flags(f)) @@ -757,6 +777,7 @@ dentries=dirlist, archives=self.archivelist(hex(node)), tags=self.nodetagsdict(node), + inbranch=self.nodeinbranch(ctx), branches=self.nodebranchdict(ctx)) def tags(self, tmpl): @@ -837,6 +858,7 @@ rev=i, node=hn, tags=self.nodetagsdict(n), + inbranch=self.nodeinbranch(ctx), branches=self.nodebranchdict(ctx))) yield l @@ -869,6 +891,7 @@ file=path, node=hex(n), rev=fctx.rev(), + branch=self.nodebranchnodefault(fctx), parent=self.siblings(parents), child=self.siblings(fctx.children()), diff=diff) diff -r d60aa0308b02 -r f295206ae1f9 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Mar 14 21:35:49 2008 +0100 +++ b/mercurial/localrepo.py Fri Mar 14 21:36:09 2008 +0100 @@ -883,13 +883,12 @@ if branchname: extra["branch"] = branchname - if use_dirstate: - lines = [line.rstrip() for line in text.rstrip().splitlines()] - while lines and not lines[0]: - del lines[0] - if not lines: - raise util.Abort(_("empty commit message")) - text = '\n'.join(lines) + lines = [line.rstrip() for line in text.rstrip().splitlines()] + while lines and not lines[0]: + del lines[0] + if not lines and use_dirstate: + raise util.Abort(_("empty commit message")) + text = '\n'.join(lines) n = self.changelog.add(mn, changed + removed, text, trp, p1, p2, user, date, extra) diff -r d60aa0308b02 -r f295206ae1f9 mercurial/merge.py --- a/mercurial/merge.py Fri Mar 14 21:35:49 2008 +0100 +++ b/mercurial/merge.py Fri Mar 14 21:36:09 2008 +0100 @@ -609,7 +609,7 @@ raise util.Abort(_("update spans branches, use 'hg merge' " "or 'hg update -C' to lose changes")) if branchmerge and not forcemerge: - if wc.files(): + if wc.files() or wc.deleted(): raise util.Abort(_("outstanding uncommitted changes")) ### calculate phase diff -r d60aa0308b02 -r f295206ae1f9 setup.py --- a/setup.py Fri Mar 14 21:35:49 2008 +0100 +++ b/setup.py Fri Mar 14 21:36:09 2008 +0100 @@ -10,13 +10,36 @@ raise SystemExit, "Mercurial requires python 2.3 or later." import os +import shutil +import tempfile from distutils.core import setup, Extension from distutils.command.install_data import install_data +from distutils.ccompiler import new_compiler import mercurial.version extra = {} +# simplified version of distutils.ccompiler.CCompiler.has_function +# that actually removes its temporary files. +def has_function(cc, funcname): + tmpdir = tempfile.mkdtemp(prefix='hg-install-') + try: + fname = os.path.join(tmpdir, 'funcname.c') + f = open(fname, 'w') + f.write('int main(void) {\n') + f.write(' %s();\n' % funcname) + f.write('}\n') + f.close() + try: + objects = cc.compile([fname]) + cc.link_executable(objects, os.path.join(tmpdir, "a.out")) + except: + return False + return True + finally: + shutil.rmtree(tmpdir) + # py2exe needs to be installed to work try: import py2exe @@ -66,10 +89,13 @@ ext_modules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'])) if sys.platform == 'linux2' and os.uname()[2] > '2.6': - # the inotify extension is only usable with Linux 2.6 kernels - ext_modules.append(Extension('hgext.inotify.linux._inotify', - ['hgext/inotify/linux/_inotify.c'])) - packages.extend(['hgext.inotify', 'hgext.inotify.linux']) + # The inotify extension is only usable with Linux 2.6 kernels. + # You also need a reasonably recent C library. + cc = new_compiler() + if has_function(cc, 'inotify_add_watch'): + ext_modules.append(Extension('hgext.inotify.linux._inotify', + ['hgext/inotify/linux/_inotify.c'])) + packages.extend(['hgext.inotify', 'hgext.inotify.linux']) except ImportError: pass diff -r d60aa0308b02 -r f295206ae1f9 templates/gitweb/changelogentry.tmpl --- a/templates/gitweb/changelogentry.tmpl Fri Mar 14 21:35:49 2008 +0100 +++ b/templates/gitweb/changelogentry.tmpl Fri Mar 14 21:36:09 2008 +0100 @@ -1,5 +1,5 @@
-#date|age# ago#desc|strip|firstline|escape# {branches%branchtag}{tags%tagtag} +#date|age# ago#desc|strip|firstline|escape# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
-#desc|strip|escape|firstline# {branches%branchtag}{tags%tagtag} +#desc|strip|escape|firstline# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
+#branch%changesetbranch# #parent%changesetparent# #child%changesetchild# diff -r d60aa0308b02 -r f295206ae1f9 templates/gitweb/fileannotate.tmpl --- a/templates/gitweb/fileannotate.tmpl Fri Mar 14 21:35:49 2008 +0100 +++ b/templates/gitweb/fileannotate.tmpl Fri Mar 14 21:36:09 2008 +0100 @@ -35,6 +35,7 @@ +#branch%filerevbranch# diff -r d60aa0308b02 -r f295206ae1f9 templates/gitweb/filediff.tmpl --- a/templates/gitweb/filediff.tmpl Fri Mar 14 21:35:49 2008 +0100 +++ b/templates/gitweb/filediff.tmpl Fri Mar 14 21:36:09 2008 +0100 @@ -28,6 +28,7 @@
{file|escape}
author#author|obfuscate#
#date|date# (#date|age# ago)
changeset {rev}{node|short}
#date|date# (#date|age# ago)
changeset {rev} #node|short#
+{branch%filerevbranch} diff -r d60aa0308b02 -r f295206ae1f9 templates/gitweb/filerevision.tmpl --- a/templates/gitweb/filerevision.tmpl Fri Mar 14 21:35:49 2008 +0100 +++ b/templates/gitweb/filerevision.tmpl Fri Mar 14 21:36:09 2008 +0100 @@ -35,6 +35,7 @@ +#branch%filerevbranch# diff -r d60aa0308b02 -r f295206ae1f9 templates/gitweb/manifest.tmpl --- a/templates/gitweb/manifest.tmpl Fri Mar 14 21:35:49 2008 +0100 +++ b/templates/gitweb/manifest.tmpl Fri Mar 14 21:36:09 2008 +0100 @@ -20,7 +20,7 @@ changeset #archives%archiveentry#
-
#path|escape# {branches%branchtag}{tags%tagtag}
+
#path|escape# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
changeset {rev} {node|short}
#date|date# (#date|age# ago)
changeset {rev} #node|short#
diff -r d60aa0308b02 -r f295206ae1f9 templates/gitweb/map --- a/templates/gitweb/map Fri Mar 14 21:35:49 2008 +0100 +++ b/templates/gitweb/map Fri Mar 14 21:36:09 2008 +0100 @@ -30,7 +30,9 @@ difflineat = '#linenumber# #line|escape#' diffline = '#linenumber# #line|escape#' changelogparent = '' +changesetbranch = '' changesetparent = '' +filerevbranch = '' filerevparent = '' filerename = '{file|escape}@' filelogrename = '| base' @@ -50,7 +52,8 @@ shortlog = shortlog.tmpl tagtag = '{name} ' branchtag = '{name} ' -shortlogentry = '' +inbranchtag = '{name} ' +shortlogentry = '' filelogentry = '' archiveentry = ' | #type|escape# ' indexentry = '\n' diff -r d60aa0308b02 -r f295206ae1f9 templates/static/style-gitweb.css --- a/templates/static/style-gitweb.css Fri Mar 14 21:35:49 2008 +0100 +++ b/templates/static/style-gitweb.css Fri Mar 14 21:36:09 2008 +0100 @@ -75,3 +75,7 @@ background-color: #aaffaa; border-color: #ccffcc #00cc33 #00cc33 #ccffcc; } +span.logtags span.inbranchtag { + background-color: #d5dde6; + border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4; +} diff -r d60aa0308b02 -r f295206ae1f9 tests/test-convert-git.out --- a/tests/test-convert-git.out Fri Mar 14 21:35:49 2008 +0100 +++ b/tests/test-convert-git.out Fri Mar 14 21:36:09 2008 +0100 @@ -10,10 +10,10 @@ 2 t4.1 1 t4.2 0 Merge branch other -changeset: 5:c6d72c98aa00 +changeset: 5:4ab1af49a271 tag: tip -parent: 3:a18bdfccf429 -parent: 4:48cb5b72ce56 +parent: 3:0222ab0998d7 +parent: 4:5333c870e3c2 user: test date: Mon Jan 01 00:00:15 2007 +0000 files: a diff -r d60aa0308b02 -r f295206ae1f9 tests/test-fetch --- a/tests/test-fetch Fri Mar 14 21:35:49 2008 +0100 +++ b/tests/test-fetch Fri Mar 14 21:36:09 2008 +0100 @@ -1,5 +1,9 @@ #!/bin/sh +# adjust to non-default HGPORT, e.g. with run-tests.py -j +hideport() { sed "s/localhost:$HGPORT/localhost:20059/"; } +hidehash() { sed "s/changeset 3:............ merges/changeset 3:... merges/"; } + echo "[extensions]" >> $HGRCPATH echo "fetch=" >> $HGRCPATH @@ -36,12 +40,12 @@ cat a/hg.pid >> "$DAEMON_PIDS" echo '% fetch over http, no auth' -hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/ -hg --cwd d tip --template '{desc}\n' +hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/ | hideport | hidehash +hg --cwd d tip --template '{desc}\n' | hideport echo '% fetch over http with auth (should be hidden in desc)' -hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/ -hg --cwd e tip --template '{desc}\n' +hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/ | hideport | hidehash +hg --cwd e tip --template '{desc}\n' | hideport hg clone a f hg clone a g diff -r d60aa0308b02 -r f295206ae1f9 tests/test-fetch.out --- a/tests/test-fetch.out Fri Mar 14 21:35:49 2008 +0100 +++ b/tests/test-fetch.out Fri Mar 14 21:36:09 2008 +0100 @@ -41,7 +41,7 @@ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved merging with 1:5e056962225c 1 files updated, 0 files merged, 0 files removed, 0 files unresolved -new changeset 3:0b6439e938f9 merges remote changes with local +new changeset 3:... merges remote changes with local Automated merge with http://localhost:20059/ % fetch over http with auth (should be hidden in desc) pulling from http://user:***@localhost:20059/ @@ -54,7 +54,7 @@ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved merging with 1:5e056962225c 1 files updated, 0 files merged, 0 files removed, 0 files unresolved -new changeset 3:0b6439e938f9 merges remote changes with local +new changeset 3:... merges remote changes with local Automated merge with http://localhost:20059/ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 2 files updated, 0 files merged, 0 files removed, 0 files unresolved diff -r d60aa0308b02 -r f295206ae1f9 tests/test-hgweb.out --- a/tests/test-hgweb.out Fri Mar 14 21:35:49 2008 +0100 +++ b/tests/test-hgweb.out Fri Mar 14 21:36:09 2008 +0100 @@ -147,4 +147,8 @@ background-color: #aaffaa; border-color: #ccffcc #00cc33 #00cc33 #ccffcc; } +span.logtags span.inbranchtag { + background-color: #d5dde6; + border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4; +} % errors diff -r d60aa0308b02 -r f295206ae1f9 tests/test-merge-force --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-merge-force Fri Mar 14 21:36:09 2008 +0100 @@ -0,0 +1,27 @@ +#!/bin/sh + +hg init repo +cd repo + +echo a > a +hg ci -qAm 'add a' + +echo b > b +hg ci -qAm 'add b' + +hg up -qC 0 +hg rm a +hg ci -m 'rm a' + +hg up -qC 1 +rm a + +echo '% local deleted a file, remote removed' +hg merge # should fail, since there are deleted files +hg -v merge --force +echo % should show a as removed +hg st + +hg ci -m merge +echo % manifest. should not have a: +hg manifest diff -r d60aa0308b02 -r f295206ae1f9 tests/test-merge-force.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-merge-force.out Fri Mar 14 21:36:09 2008 +0100 @@ -0,0 +1,10 @@ +% local deleted a file, remote removed +abort: outstanding uncommitted changes +resolving manifests +removing a +0 files updated, 0 files merged, 1 files removed, 0 files unresolved +(branch merge, don't forget to commit) +% should show a as removed +R a +% manifest. should not have a: +b diff -r d60aa0308b02 -r f295206ae1f9 tests/test-symlink-basic --- a/tests/test-symlink-basic Fri Mar 14 21:35:49 2008 +0100 +++ b/tests/test-symlink-basic Fri Mar 14 21:36:09 2008 +0100 @@ -38,3 +38,13 @@ hg cp -v dangling dangling2 hg st -Cmard $TESTDIR/readlink.py dangling dangling2 + +echo '% issue995' +hg up -C +mkdir dir +ln -s dir dirlink +hg ci -qAm 'add dirlink' +mkdir newdir +mv dir newdir/dir +mv dirlink newdir/dirlink +hg mv -A dirlink newdir/dirlink diff -r d60aa0308b02 -r f295206ae1f9 tests/test-symlink-basic.out --- a/tests/test-symlink-basic.out Fri Mar 14 21:35:49 2008 +0100 +++ b/tests/test-symlink-basic.out Fri Mar 14 21:36:09 2008 +0100 @@ -27,3 +27,5 @@ dangling dangling -> void dangling2 -> void +% issue995 +0 files updated, 0 files merged, 1 files removed, 0 files unresolved
drwxr-xr-x
parent #rev#:#node|short#
branch{name}
parent {rev}{node|short}
branch{name}
parent {rev}{rename%filerename}{node|short}
#date|age# ago#author|person##desc|strip|firstline|escape# {branches%branchtag}{tags%tagtag}
#date|age# ago#author|person##desc|strip|firstline|escape# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
#date|age# ago#desc|strip|firstline|escape#
{name|escape}{description}{contact|obfuscate}{lastchange|age} ago