# HG changeset patch # User Benoit Boissinot # Date 1134666279 -3600 # Node ID 675ca845c2f891b549ef96b12aa30cd7e21f2505 # Parent b345cc4c22c0aaaa649048273a65f8e1fdc10862# Parent a679a364436ada124b787f9d65932c74fceed0fa Merge with upstream diff -r b345cc4c22c0 -r 675ca845c2f8 contrib/bash_completion --- a/contrib/bash_completion Thu Dec 15 18:04:05 2005 +0100 +++ b/contrib/bash_completion Thu Dec 15 18:04:39 2005 +0100 @@ -29,6 +29,14 @@ COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$paths" -- "$cur" )) } +_hg_repos() +{ + local i + for i in $( compgen -d -- "$cur" ); do + test ! -d "$i"/.hg || COMPREPLY=(${COMPREPLY[@]:-} "$i") + done +} + _hg_status() { local files="$( hg status -$1 | cut -b 3- )" @@ -92,11 +100,11 @@ # global options case "$prev" in -R|--repository) - COMPREPLY=(${COMPREPLY[@]:-} $( compgen -d -- "$cur" )) + _hg_repos return ;; --cwd) - COMPREPLY=(${COMPREPLY[@]:-} $( compgen -d -- "$cur" )) + # Stick with default bash completion return ;; esac @@ -123,7 +131,7 @@ ;; pull|push|outgoing|incoming) _hg_paths - COMPREPLY=(${COMPREPLY[@]:-} $( compgen -d -- "$cur" )) + _hg_repos ;; paths) _hg_paths @@ -151,7 +159,7 @@ if [ $count = 1 ]; then _hg_paths fi - COMPREPLY=(${COMPREPLY[@]:-} $( compgen -d -- "$cur" )) + _hg_repos ;; debugindex|debugindexdot) COMPREPLY=(${COMPREPLY[@]:-} $( compgen -f -X "!*.i" -- "$cur" )) diff -r b345cc4c22c0 -r 675ca845c2f8 doc/hgrc.5.txt --- a/doc/hgrc.5.txt Thu Dec 15 18:04:05 2005 +0100 +++ b/doc/hgrc.5.txt Thu Dec 15 18:04:39 2005 +0100 @@ -15,26 +15,38 @@ FILES ----- -Mercurial reads configuration data from up to three files, if they -exist. The names of these files depend on the system on which -Mercurial is installed. +Mercurial reads configuration data from several files, if they exist. +The names of these files depend on the system on which Mercurial is +installed. +(Unix) /etc/mercurial/hgrc.d/*.rc:: +(Unix) /etc/mercurial/hgrc:: + Per-installation configuration files, searched for in the + directory where Mercurial is installed. For example, if installed + in /shared/tools, Mercurial will look in + /shared/tools/etc/mercurial/hgrc. Options in these files apply to + all Mercurial commands executed by any user in any directory. + +(Unix) /etc/mercurial/hgrc.d/*.rc:: (Unix) /etc/mercurial/hgrc:: (Windows) C:\Mercurial\Mercurial.ini:: - Options in this global configuration file apply to all Mercurial - commands executed by any user in any directory. + Per-system configuration files, for the system on which Mercurial + is running. Options in these files apply to all Mercurial + commands executed by any user in any directory. Options in these + files override per-installation options. (Unix) $HOME/.hgrc:: (Windows) C:\Documents and Settings\USERNAME\Mercurial.ini - Per-user configuration options that apply to all Mercurial commands, - no matter from which directory they are run. Values in this file - override global settings. + Per-user configuration file, for the user running Mercurial. + Options in this file apply to all Mercurial commands executed by + any user in any directory. Options in this file override + per-installation and per-system options. (Unix, Windows) /.hg/hgrc:: Per-repository configuration options that only apply in a particular repository. This file is not version-controlled, and - will not get transferred during a "clone" operation. Values in - this file override global and per-user settings. + will not get transferred during a "clone" operation. Options in + this file override options in all other configuration files. SYNTAX ------ diff -r b345cc4c22c0 -r 675ca845c2f8 mercurial/commands.py --- a/mercurial/commands.py Thu Dec 15 18:04:05 2005 +0100 +++ b/mercurial/commands.py Thu Dec 15 18:04:39 2005 +0100 @@ -66,7 +66,7 @@ window, we first walk forwards to gather data, then in the desired order (usually backwards) to display it. - This function returns an (iterator, getchange) pair. The + This function returns an (iterator, getchange, matchfn) tuple. The getchange function returns the changelog entry for a numeric revision. The iterator yields 3-tuples. They will be of one of the following forms: @@ -82,10 +82,11 @@ "iter", rev, None: in-order traversal of the revs earlier iterated over with "add" - use to display data''' + files, matchfn, anypats, cwd = matchpats(repo, pats, opts) + if repo.changelog.count() == 0: - return [], False + return [], False, matchfn - files, matchfn, anypats, cwd = matchpats(repo, pats, opts) revs = map(int, revrange(ui, repo, opts['rev'] or ['tip:0'])) wanted = {} slowpath = anypats @@ -153,7 +154,7 @@ yield 'add', rev, fns for rev in nrevs: yield 'iter', rev, None - return iterate(), getchange + return iterate(), getchange, matchfn revrangesep = ':' @@ -1117,9 +1118,12 @@ def doexport(ui, repo, changeset, seqno, total, revwidth, opts): node = repo.lookup(changeset) - prev, other = repo.changelog.parents(node) + parents = [p for p in repo.changelog.parents(node) if p != nullid] + prev = (parents and parents[0]) or nullid change = repo.changelog.read(node) + if opts['switch_parent']: + parents.reverse() fp = make_file(repo, repo.changelog, opts['output'], node=node, total=total, seqno=seqno, revwidth=revwidth) @@ -1130,8 +1134,8 @@ fp.write("# User %s\n" % change[1]) fp.write("# Node ID %s\n" % hex(node)) fp.write("# Parent %s\n" % hex(prev)) - if other != nullid: - fp.write("# Parent %s\n" % hex(other)) + if len(parents) > 1: + fp.write("# Parent %s\n" % hex(parents[1])) fp.write(change[4].rstrip()) fp.write("\n\n") @@ -1162,6 +1166,9 @@ Without the -a option, export will avoid generating diffs of files it detects as binary. With -a, export will generate a diff anyway, probably with undesirable results. + + With the --switch-parent option, the diff will be against the second + parent. It can be useful to review a merge. """ if not changesets: raise util.Abort(_("export requires at least one changeset")) @@ -1281,7 +1288,7 @@ fstate = {} skip = {} - changeiter, getchange = walkchangerevs(ui, repo, pats, opts) + changeiter, getchange, matchfn = walkchangerevs(ui, repo, pats, opts) count = 0 incrementing = False for st, rev, fns in changeiter: @@ -1544,7 +1551,7 @@ self.write(*args) def __getattr__(self, key): return getattr(self.ui, key) - changeiter, getchange = walkchangerevs(ui, repo, pats, opts) + changeiter, getchange, matchfn = walkchangerevs(ui, repo, pats, opts) for st, rev, fns in changeiter: if st == 'window': du = dui(ui) @@ -1560,7 +1567,7 @@ br = None if opts['keyword']: - changes = repo.changelog.read(repo.changelog.node(rev)) + changes = getchange(rev) miss = 0 for k in [kw.lower() for kw in opts['keyword']]: if not (k in changes[1].lower() or @@ -1577,7 +1584,7 @@ show_changeset(du, repo, rev, brinfo=br) if opts['patch']: prev = (parents and parents[0]) or nullid - dodiff(du, du, repo, prev, changenode, fns) + dodiff(du, du, repo, prev, changenode, match=matchfn) du.write("\n\n") elif st == 'iter': for args in du.hunk[rev]: @@ -2122,7 +2129,8 @@ """ repo.undo() -def update(ui, repo, node=None, merge=False, clean=False, branch=None): +def update(ui, repo, node=None, merge=False, clean=False, force=None, + branch=None): """update or merge working directory Update the working directory to the specified revision. @@ -2159,7 +2167,7 @@ return 1 else: node = node and repo.lookup(node) or repo.changelog.tip() - return repo.update(node, allow=merge, force=clean) + return repo.update(node, allow=merge, force=clean, forcemerge=force) def verify(ui, repo): """verify the integrity of the repository @@ -2256,7 +2264,8 @@ "^export": (export, [('o', 'output', "", _('print output to file with formatted name')), - ('a', 'text', None, _('treat all files as text'))], + ('a', 'text', None, _('treat all files as text')), + ('', 'switch-parent', None, _('diff against the second parent'))], "hg export [-a] [-o OUTFILE] REV..."), "forget": (forget, @@ -2404,8 +2413,9 @@ (update, [('b', 'branch', "", _('checkout the head of a specific branch')), ('m', 'merge', None, _('allow merging of branches')), - ('C', 'clean', None, _('overwrite locally modified files'))], - _('hg update [-b TAG] [-m] [-C] [REV]')), + ('C', 'clean', None, _('overwrite locally modified files')), + ('f', 'force', None, _('force a merge with outstanding changes'))], + _('hg update [-b TAG] [-m] [-C] [-f] [REV]')), "verify": (verify, [], _('hg verify')), "version": (show_version, [], _('hg version')), } diff -r b345cc4c22c0 -r 675ca845c2f8 mercurial/hgweb.py --- a/mercurial/hgweb.py Thu Dec 15 18:04:05 2005 +0100 +++ b/mercurial/hgweb.py Thu Dec 15 18:04:39 2005 +0100 @@ -632,6 +632,8 @@ for k,n in i: yield {"parity": parity, "tag": k, + "tagmanifest": hex(cl.read(n)[0]), + "date": cl.read(n)[2], "node": hex(n)} parity = 1 - parity @@ -639,6 +641,76 @@ manifest=hex(mf), entries=entries) + def summary(self): + cl = self.repo.changelog + mf = cl.read(cl.tip())[0] + + i = self.repo.tagslist() + i.reverse() + + def tagentries(**map): + parity = 0 + count = 0 + for k,n in i: + if k == "tip": # skip tip + continue; + + count += 1 + if count > 10: # limit to 10 tags + break; + + c = cl.read(n) + m = c[0] + t = c[2] + + yield self.t("tagentry", + parity = parity, + tag = k, + node = hex(n), + date = t, + tagmanifest = hex(m)) + parity = 1 - parity + + def changelist(**map): + parity = 0 + cl = self.repo.changelog + l = [] # build a list in forward order for efficiency + for i in range(start, end): + n = cl.node(i) + changes = cl.read(n) + hn = hex(n) + t = changes[2] + + l.insert(0, self.t( + 'shortlogentry', + parity = parity, + author = changes[1], + manifest = hex(changes[0]), + desc = changes[4], + date = t, + rev = i, + node = hn)) + parity = 1 - parity + + yield l + + cl = self.repo.changelog + mf = cl.read(cl.tip())[0] + count = cl.count() + start = max(0, count - self.maxchanges) + end = min(count, start + self.maxchanges) + pos = end - 1 + + yield self.t("summary", + desc = self.repo.ui.config("web", "description", "unknown"), + owner = (self.repo.ui.config("ui", "username") or # preferred + self.repo.ui.config("web", "contact") or # deprecated + self.repo.ui.config("web", "author", "unknown")), # also + lastchange = (0, 0), # FIXME + manifest = hex(mf), + tags = tagentries, + shortlog = changelist) + def filediff(self, file, changeset): cl = self.repo.changelog n = self.repo.lookup(changeset) @@ -798,6 +870,9 @@ elif req.form['cmd'][0] == 'tags': req.write(self.tags()) + elif req.form['cmd'][0] == 'summary': + req.write(self.summary()) + elif req.form['cmd'][0] == 'filediff': req.write(self.filediff(req.form['file'][0], req.form['node'][0])) diff -r b345cc4c22c0 -r 675ca845c2f8 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Dec 15 18:04:05 2005 +0100 +++ b/mercurial/localrepo.py Thu Dec 15 18:04:39 2005 +0100 @@ -24,7 +24,7 @@ self.path = os.path.join(path, ".hg") if not create and not os.path.isdir(self.path): - raise repo.RepoError(_("repository %s not found") % self.path) + raise repo.RepoError(_("repository %s not found") % path) self.root = os.path.abspath(path) self.ui = ui @@ -1364,7 +1364,7 @@ return def update(self, node, allow=False, force=False, choose=None, - moddirstate=True): + moddirstate=True, forcemerge=False): pl = self.dirstate.parents() if not force and pl[1] != nullid: self.ui.warn(_("aborting: outstanding uncommitted merges\n")) @@ -1384,6 +1384,18 @@ (c, a, d, u) = self.changes() + if allow and not forcemerge: + if c or a or d: + raise util.Abort(_("outstanding uncommited changes")) + if not forcemerge and not force: + for f in u: + if f in m2: + t1 = self.wread(f) + t2 = self.file(f).read(m2[f]) + if cmp(t1, t2) != 0: + raise util.Abort(_("'%s' already exists in the working" + " dir and differs from remote") % f) + # is this a jump, or a merge? i.e. is there a linear path # from p1 to p2? linear_path = (pa == p1 or pa == p2) diff -r b345cc4c22c0 -r 675ca845c2f8 mercurial/ui.py --- a/mercurial/ui.py Thu Dec 15 18:04:05 2005 +0100 +++ b/mercurial/ui.py Thu Dec 15 18:04:39 2005 +0100 @@ -145,7 +145,7 @@ os.environ.get("EDITOR", "vi")) os.environ["HGUSER"] = self.username() - util.system("%s %s" % (editor, name), errprefix=_("edit failed")) + util.system("%s \"%s\"" % (editor, name), errprefix=_("edit failed")) t = open(name).read() t = re.sub("(?m)^HG:.*\n", "", t) diff -r b345cc4c22c0 -r 675ca845c2f8 mercurial/util.py --- a/mercurial/util.py Thu Dec 15 18:04:05 2005 +0100 +++ b/mercurial/util.py Thu Dec 15 18:04:39 2005 +0100 @@ -13,7 +13,7 @@ import os, errno from i18n import gettext as _ from demandload import * -demandload(globals(), "re cStringIO shutil popen2 tempfile threading time") +demandload(globals(), "re cStringIO shutil popen2 sys tempfile threading time") def pipefilter(s, cmd): '''filter string S through command CMD, returning its output''' @@ -510,12 +510,18 @@ else: nulldev = '/dev/null' - hgrcd = '/etc/mercurial/hgrc.d' - hgrcs = [] - if os.path.isdir(hgrcd): - hgrcs = [f for f in os.listdir(hgrcd) if f.endswith(".rc")] - rcpath = map(os.path.normpath, hgrcs + - ['/etc/mercurial/hgrc', os.path.expanduser('~/.hgrc')]) + def rcfiles(path): + rcs = [os.path.join(path, 'hgrc')] + rcdir = os.path.join(path, 'hgrc.d') + try: + rcs.extend([os.path.join(rcdir, f) for f in os.listdir(rcdir) + if f.endswith(".rc")]) + except OSError, inst: pass + return rcs + rcpath = rcfiles(os.path.dirname(sys.argv[0]) + '/../etc/mercurial') + rcpath.extend(rcfiles('/etc/mercurial')) + rcpath.append(os.path.expanduser('~/.hgrc')) + rcpath = [os.path.normpath(f) for f in rcpath] def parse_patch_output(output_line): """parses the output produced by patch and returns the file name""" diff -r b345cc4c22c0 -r 675ca845c2f8 templates/changelog-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/changelog-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,30 @@ +#header# +#repo|escape#: Changelog + + + + + + +
+ +
+ + + + +#entries%changelogentry# + +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/changelogentry-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/changelogentry-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,14 @@ +
+#date|age# ago#desc|firstline|escape# +
+
+ +#author|obfuscate# [#date|rfc822date#]
+
+
+#desc|addbreaks# +
+
+
diff -r b345cc4c22c0 -r 675ca845c2f8 templates/changeset-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/changeset-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,40 @@ +#header# +#repo|escape#: Changeset + + + + + + + + +
+#desc|escape|firstline# +
+
+ + + + + +#parent%changesetparent# +#changesettag# +
author#author|obfuscate#
#date|date# (#date|age# ago)
changeset#node|short#
manifest#manifest|short#
+ +
+#desc|addbreaks# +
+ +
+ +#files# +
+ +
#diff#
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/error-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/error-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,12 @@ +#header# + + +
+
+Error parsing query string
+
+
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/fileannotate-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/fileannotate-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,43 @@ +#header# +#repo|escape#: Annotate + + + + + + + + +
#file#
+ + + + + +#parent%fileannotateparent# + + + + + + + + + + + + +
changeset #rev#:#node|short#
manifest:#manifest|short#
author:#author|obfuscate#
date:#date|date# (#date|age# ago)
permissions:#permissions|permissions#
+ +
+ +#annotate%annotateline# +
+
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/filelog-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/filelog-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,20 @@ +#header# +#repo|escape#: Manifest + + + + + + + + + +#entries%filelogentry# +
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/filerevision-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/filerevision-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,41 @@ +#header# +#repo|escape#: File revision + + + + + + + + +
#file#
+ + + + + +#parent%fileannotateparent# + + + + + + + + + + + + +
changeset #rev#:#node|short#
manifest:#manifest|short#
author:#author|obfuscate#
date:#date|date# (#date|age# ago)
permissions:#permissions|permissions#
+ +
+#text%fileline# +
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/footer-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/footer-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,6 @@ + + + diff -r b345cc4c22c0 -r 675ca845c2f8 templates/header-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/header-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,59 @@ +Content-type: text/html + + + + + + + + + diff -r b345cc4c22c0 -r 675ca845c2f8 templates/manifest-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/manifest-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,27 @@ +#header# +#repo|escape#: Manifest + + + + + + + + +
#path|escape#
+
+ + + + + + +#dentries%manifestdirentry# +#fentries%manifestfileentry# +
drwxr-xr-x[up]
+#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/map-gitweb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/map-gitweb Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,42 @@ +default = "summary" +header = header-gitweb.tmpl +footer = footer-gitweb.tmpl +search = search-gitweb.tmpl +changelog = changelog-gitweb.tmpl +summary = summary-gitweb.tmpl +error = error-gitweb.tmpl +naventry = "#label# " +navshortentry = "#label# " +filedifflink = "#file# " +filenodelink = "#file#file | revisions" +fileellipses = "..." +changelogentry = changelogentry-gitweb.tmpl +searchentry = changelogentry-gitweb.tmpl +changeset = changeset-gitweb.tmpl +manifest = manifest-gitweb.tmpl +manifestdirentry = "drwxr-xr-x#basename#/manifest" +manifestfileentry = "#permissions|permissions##basename#file | revisions | annotate" +filerevision = filerevision-gitweb.tmpl +fileannotate = fileannotate-gitweb.tmpl +filelog = filelog-gitweb.tmpl +fileline = "
#linenumber# #line|escape#
" +filelogentry = filelogentry-gitweb.tmpl +annotateline = "#author|obfuscate#@#rev##line|escape#" +difflineplus = "
#line|escape#
" +difflineminus = "
#line|escape#
" +difflineat = "
#line|escape#
" +diffline = "
#line|escape#
" +changelogparent = "parent #rev#:#node|short#" +changesetparent = "parent#node|short#" +filerevparent = "parent:#node|short#" +fileannotateparent = "parent:#node|short#" +tags = tags-gitweb.tmpl +tagentry = "#date|age# ago#tag#changeset | changelog | manifest" +diffblock = "#lines#" +changelogtag = "tag:#tag#" +changesettag = "tag#tag#" +filediffparent = "parent #rev#:#node|short#" +filelogparent = "parent #rev#: #node|short#" +shortlog = shortlog-gitweb.tmpl +shortlogentry = "#date|age# ago#desc|firstline|escape#changeset | manifest" +filelogentry = "#date|age# ago#desc|firstline|escape# annotate" diff -r b345cc4c22c0 -r 675ca845c2f8 templates/search-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/search-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,24 @@ +#header# + + +

searching for #query|escape#

+ +
+search: + + + +
+ +#entries# + +
+search: + + + +
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/shortlog-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/shortlog-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,13 @@ +#header# + + + + +#entries# +
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/summary-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/summary-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,34 @@ +#header# +#repo|escape#: Summary + + + + + + + +
 
+ + + + +
description#desc#
owner#owner#
+ + + +#shortlog# + +
...
+ + + +#tags# + +
...
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 templates/tags-gitweb.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/tags-gitweb.tmpl Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,21 @@ +#header# +#repo|escape#: Tags + + + + + + + + + +#entries%tagentry# +
+ +#footer# diff -r b345cc4c22c0 -r 675ca845c2f8 tests/test-clone-failure.out --- a/tests/test-clone-failure.out Thu Dec 15 18:04:05 2005 +0100 +++ b/tests/test-clone-failure.out Thu Dec 15 18:04:39 2005 +0100 @@ -1,12 +1,12 @@ -abort: repository a/.hg not found! +abort: repository a not found! 255 requesting all changes abort: error: Connection refused 255 -abort: repository a/.hg not found! +abort: repository a not found! 255 abort: destination '../a' already exists 1 -abort: repository a/.hg not found! +abort: repository a not found! 255 abort: destination 'q' already exists diff -r b345cc4c22c0 -r 675ca845c2f8 tests/test-merge1 --- a/tests/test-merge1 Thu Dec 15 18:04:05 2005 +0100 +++ b/tests/test-merge1 Thu Dec 15 18:04:39 2005 +0100 @@ -40,8 +40,10 @@ hg add c hg commit -m "commit #2" -d "0 0" echo This is file b2 > b +echo %% merge should fail +env HGMERGE=../merge hg update -m 1 echo %% merge of b expected -env HGMERGE=../merge hg update -m 1 +env HGMERGE=../merge hg update -f -m 1 cd ..; /bin/rm -rf t echo %% @@ -65,8 +67,10 @@ cat b echo This is file b22 > b +echo %% merge fails +env HGMERGE=../merge hg update -m 2 echo %% merge expected! -env HGMERGE=../merge hg update -m 2 +env HGMERGE=../merge hg update -f -m 2 cd ..; /bin/rm -rf t mkdir t @@ -85,6 +89,8 @@ hg add c hg commit -m "commit #3" -d "0 0" echo This is file b33 > b -echo %% merge of b expected +echo %% merge of b should fail env HGMERGE=../merge hg update -m 2 +echo %% merge of b expected +env HGMERGE=../merge hg update -f -m 2 cd ..; /bin/rm -rf t diff -r b345cc4c22c0 -r 675ca845c2f8 tests/test-merge1.out --- a/tests/test-merge1.out Thu Dec 15 18:04:05 2005 +0100 +++ b/tests/test-merge1.out Thu Dec 15 18:04:39 2005 +0100 @@ -1,13 +1,19 @@ %% no merges expected +%% merge should fail +abort: 'b' already exists in the working dir and differs from remote %% merge of b expected merging for b merging b %% Contents of b should be "this is file b1" This is file b1 +%% merge fails +abort: outstanding uncommited changes %% merge expected! merging for b merging b +%% merge of b should fail +abort: outstanding uncommited changes %% merge of b expected merging for b merging b diff -r b345cc4c22c0 -r 675ca845c2f8 tests/test-remove --- a/tests/test-remove Thu Dec 15 18:04:05 2005 +0100 +++ b/tests/test-remove Thu Dec 15 18:04:39 2005 +0100 @@ -8,6 +8,10 @@ rm foo hg remove foo hg commit -m 2 -d "0 0" +hg export 0 +hg export 1 +hg log -p -r 0 +hg log -p -r 1 cd .. hg clone a b diff -r b345cc4c22c0 -r 675ca845c2f8 tests/test-remove.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-remove.out Thu Dec 15 18:04:39 2005 +0100 @@ -0,0 +1,47 @@ +# HG changeset patch +# User test +# Node ID b51ca55c20354097ca299529d18b5cd356976ba2 +# Parent 0000000000000000000000000000000000000000 +1 + +diff -r 000000000000 -r b51ca55c2035 foo +--- /dev/null Thu Jan 1 00:00:00 1970 +0000 ++++ b/foo Thu Jan 1 00:00:00 1970 +0000 +@@ -0,0 +1,1 @@ ++a +# HG changeset patch +# User test +# Node ID 1e555b9b85c52e1e9e8175446f1ede507b2d1ebb +# Parent b51ca55c20354097ca299529d18b5cd356976ba2 +2 + +diff -r b51ca55c2035 -r 1e555b9b85c5 foo +--- a/foo Thu Jan 1 00:00:00 1970 +0000 ++++ /dev/null Thu Jan 1 00:00:00 1970 +0000 +@@ -1,1 +0,0 @@ +-a +changeset: 0:b51ca55c2035 +user: test +date: Thu Jan 1 00:00:00 1970 +0000 +summary: 1 + +diff -r 000000000000 -r b51ca55c2035 foo +--- /dev/null Thu Jan 1 00:00:00 1970 +0000 ++++ b/foo Thu Jan 1 00:00:00 1970 +0000 +@@ -0,0 +1,1 @@ ++a + + +changeset: 1:1e555b9b85c5 +tag: tip +user: test +date: Thu Jan 1 00:00:00 1970 +0000 +summary: 2 + +diff -r b51ca55c2035 -r 1e555b9b85c5 foo +--- a/foo Thu Jan 1 00:00:00 1970 +0000 ++++ /dev/null Thu Jan 1 00:00:00 1970 +0000 +@@ -1,1 +0,0 @@ +-a + + diff -r b345cc4c22c0 -r 675ca845c2f8 tests/test-up-local-change --- a/tests/test-up-local-change Thu Dec 15 18:04:05 2005 +0100 +++ b/tests/test-up-local-change Thu Dec 15 18:04:39 2005 +0100 @@ -25,7 +25,8 @@ hg -q pull ../r1 hg status hg --debug up -hg --debug up -m +hg --debug up -m || echo failed +hg --debug up -f -m hg parents hg -v history hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ diff -r b345cc4c22c0 -r 675ca845c2f8 tests/test-up-local-change.out --- a/tests/test-up-local-change.out Thu Dec 15 18:04:05 2005 +0100 +++ b/tests/test-up-local-change.out Thu Dec 15 18:04:39 2005 +0100 @@ -16,6 +16,8 @@ merging a resolving a file a: my b789fdd96dc2 other d730145abbf9 ancestor b789fdd96dc2 +abort: outstanding uncommited changes +failed resolving manifests force None allow 1 moddirstate True linear True ancestor 1165e8bd193e local 1165e8bd193e remote 1165e8bd193e