Mercurial > hg > pyhgsh
changeset 464:50da4bb9cab6
Merge from http://moffetthome.net:8012/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Merge from http://moffetthome.net:8012/
manifest hash: 3a67864af6b0276eabe640274633ca2625dbd4a5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCvQKkywK+sNU5EO8RArUHAKCSGtpEfJwYGoAIpj4mBDvcPted9wCgnzML
xr8WQ8DdPkJ9DVsLjvsbhJU=
=O7Fd
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Fri, 24 Jun 2005 23:07:16 -0800 |
parents | 512d76558bd4 (diff) ea93402b81b9 (current diff) |
children | f8cb8d082d40 |
files | mercurial/bdiff.c mercurial/commands.py mercurial/mpatch.c mercurial/util.py mercurial/version.py tests/test-copy tests/test-copy.out |
diffstat | 6 files changed, 102 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/mercurial.spec Fri Jun 24 23:07:16 2005 -0800 @@ -0,0 +1,48 @@ +Summary: Mercurial -- a distributed SCM +Name: mercurial +Version: 0.6 +Release: 1 +Copyright: GPL +Group: Development/Tools +Distribution: RedHat +Source: http://www.selenic.com/mercurial/release/%{name}-%{version}.tar.gz +Packager: Arun Sharma <arun@sharma-home.net> +Prefix: /usr +BuildRoot: /tmp/build.%{name}-%{version}-%{release} + +%description + +Mercurial is a fast, lightweight source control management system designed +for efficient handling of very large distributed projects. + +%prep + +rm -rf $RPM_BUILD_ROOT + +%setup -q -n %{name}-%{version} + +%build + +python setup.py build + +%install + +python setup.py install --root $RPM_BUILD_ROOT + +cd $RPM_BUILD_ROOT +find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > \ + $RPM_BUILD_DIR/file.list.%{name} + +find . -type f | sed -e 's,^\.,\%attr(-\,root\,root) ,' \ + -e '/\/config\//s|^|%config|' \ + -e '/\/applnk\//s|^|%config|' >> \ + $RPM_BUILD_DIR/file.list.%{name} + +find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> \ + $RPM_BUILD_DIR/file.list.%{name} + +%clean +rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/file.list.%{name} + +%files -f ../file.list.%{name} +%doc doc
--- a/mercurial/commands.py Fri Jun 24 20:53:51 2005 -0500 +++ b/mercurial/commands.py Fri Jun 24 23:07:16 2005 -0800 @@ -275,6 +275,43 @@ """mark a file as copied or renamed for the next commit""" return repo.copy(*relpath(repo, (source, dest))) +def debugcheckdirstate(ui, repo): + parent1, parent2 = repo.dirstate.parents() + dc = repo.dirstate.dup() + keys = dc.keys() + keys.sort() + m1n = repo.changelog.read(parent1)[0] + m2n = repo.changelog.read(parent2)[0] + m1 = repo.manifest.read(m1n) + m2 = repo.manifest.read(m2n) + errors = 0 + for f in dc: + state = repo.dirstate.state(f) + if state in "nr" and f not in m1: + print "%s in state %s, but not listed in manifest1" % (f, state) + errors += 1 + if state in "a" and f in m1: + print "%s in state %s, but also listed in manifest1" % (f, state) + errors += 1 + if state in "m" and f not in m1 and f not in m2: + print "%s in state %s, but not listed in either manifest" % (f, state) + errors += 1 + for f in m1: + state = repo.dirstate.state(f) + if state not in "nrm": + print "%s in manifest1, but listed as state %s" % (f, state) + errors += 1 + if errors: + print ".hg/dirstate inconsistent with current parent's manifest, aborting" + sys.exit(1) + +def debugdumpdirstate(ui, repo): + dc = repo.dirstate.dup() + keys = dc.keys() + keys.sort() + for file in keys: + print "%s => %c" % (file, dc[file][0]) + def debugindex(ui, file): r = hg.revlog(hg.opener(""), file, "") print " rev offset length base linkrev"+\ @@ -376,7 +413,6 @@ d = opts["base"] strip = opts["strip"] - quiet = ui.quiet and "> /dev/null" or "" for patch in patches: ui.status("applying %s\n" % patch) @@ -677,6 +713,8 @@ ('u', 'user', "", 'user')], 'hg commit [files]'), "copy": (copy, [], 'hg copy <source> <dest>'), + "debugcheckdirstate": (debugcheckdirstate, [], 'debugcheckdirstate'), + "debugdumpdirstate": (debugdumpdirstate, [], 'debugdumpdirstate'), "debugindex": (debugindex, [], 'debugindex <file>'), "debugindexdot": (debugindexdot, [], 'debugindexdot <file>'), "diff": (diff, [('r', 'rev', [], 'revision')],
--- a/mercurial/util.py Fri Jun 24 20:53:51 2005 -0500 +++ b/mercurial/util.py Fri Jun 24 23:07:16 2005 -0800 @@ -16,6 +16,8 @@ # Platfor specific varients if os.name == 'nt': + nulldev = 'NUL:' + def is_exec(f, last): return last @@ -32,7 +34,10 @@ def readlock(pathname): return file(pathname).read() + else: + nulldev = '/dev/null' + def is_exec(f, last): return (os.stat(f).st_mode & 0100 != 0) @@ -57,5 +62,3 @@ def readlock(pathname): return os.readlink(pathname) - -
--- a/mercurial/version.py Fri Jun 24 20:53:51 2005 -0500 +++ b/mercurial/version.py Fri Jun 24 23:07:16 2005 -0800 @@ -13,6 +13,7 @@ import os.path import re import time +import util unknown_version = 'unknown' remembered_version = False @@ -37,7 +38,7 @@ """Store version information.""" global remembered_version if not version and os.path.isdir(".hg"): - f = os.popen("hg identify 2>/dev/null") # use real hg installation + f = os.popen("hg identify 2> %s" % util.nulldev) # use real hg installation ident = f.read()[:-1] if not f.close() and ident: ids = ident.split(' ', 1)
--- a/tests/test-copy Fri Jun 24 20:53:51 2005 -0500 +++ b/tests/test-copy Fri Jun 24 23:07:16 2005 -0800 @@ -13,6 +13,8 @@ hg history hg log a hexdump -C .hg/data/b.d -hg cat b | md5sum -hg cat a | md5sum +hg cat b > bsum +md5sum bsum +hg cat a > asum +md5sum asum hg verify
--- a/tests/test-copy.out Fri Jun 24 20:53:51 2005 -0500 +++ b/tests/test-copy.out Fri Jun 24 23:07:16 2005 -0800 @@ -39,11 +39,11 @@ 00000040 0a |.| 00000041 + hg cat b -+ md5sum -60b725f10c9c85c70d97880dfe8191b3 - ++ md5sum bsum +60b725f10c9c85c70d97880dfe8191b3 bsum + hg cat a -+ md5sum -60b725f10c9c85c70d97880dfe8191b3 - ++ md5sum asum +60b725f10c9c85c70d97880dfe8191b3 asum + hg verify checking changesets checking manifests