Commit Graph

7089 Commits

Author SHA1 Message Date
Markus F.X.J. Oberhumer
159a87219b bdiff.c: rename all variables which hold a hash value to "hash" 2011-03-23 02:33:24 +01:00
Markus F.X.J. Oberhumer
b841bede91 bdiff.c: use unsigned arithmetic for hash computation
Signed integer overflow is undefined in C.
2011-03-23 02:33:23 +01:00
Markus F.X.J. Oberhumer
26bf54022b bdiff.c: cast to unsigned char when computing hash value 2011-03-23 02:33:22 +01:00
Markus F.X.J. Oberhumer
a68114a4d1 bdiff.c: make all local functions static 2011-03-23 02:33:21 +01:00
Matt Mackall
f8809566c2 merge with stable 2011-03-23 09:20:40 -05:00
Matt Mackall
70da923d41 debugbundle: fix up long line caught by check-code 2011-03-22 21:27:51 -05:00
Matt Mackall
eec1a7b126 wireproto: avoid naked excepts 2011-03-22 21:26:19 -05:00
Peter Arrenbrecht
4e49d0830f commands: add debugbundle command
Lists ids contained in a bundle file. Useful for testing bundle-related commands.
2011-03-22 09:22:29 +01:00
Peter Arrenbrecht
d542bac8c7 wireproto: add known([id]) function
known([Node]) -> [1/0]

Returns 1/0 for each node, indicating whether it's known by the server.
Needed for new discovery protocols introduced in later patches.
2011-03-22 09:22:21 +01:00
Peter Arrenbrecht
54d1d4736b wireproto: fix decodelist to properly return empty list
Needed by tests for next patch introducing known().
2011-03-22 07:40:02 +01:00
Peter Arrenbrecht
5925b26799 wireproto: fix handling of '*' args for HTTP and SSH 2011-03-22 07:38:32 +01:00
Peter Arrenbrecht
375ab88b9f debug: add debugwireargs to test argument passing over the wire
Tests argument passing locally, via HTTP, and via SSH. This is mainly preparation
for the next patch.
2011-03-22 07:38:32 +01:00
Peter Arrenbrecht
27bf9fafce sshserver: drop unnecessary line 2011-03-22 07:37:56 +01:00
Matt Mackall
8a1d106a60 changegroup: minor cleanups 2011-03-20 20:25:41 -05:00
Matt Mackall
00a0332ced repair: revlog has an iterator 2011-03-20 20:21:19 -05:00
Matt Mackall
5468a6deab changegroup: fix leftover from delta read 2011-03-20 20:17:57 -05:00
Matt Mackall
6c9dcf752e changegroup: drop expensive redundant usage of readdelta for progress 2011-03-20 20:16:51 -05:00
Matt Mackall
d4b4c17c11 changegroupsubset: use manifest.readfast to simplify collector 2011-03-20 19:43:28 -05:00
Matt Mackall
5be0491c06 manifest: add readfast method 2011-03-20 19:43:28 -05:00
Matt Mackall
3e746ce14e changegroupsubset: simplify filenode_collector 2011-03-20 19:43:28 -05:00
Matt Mackall
91e167ab79 changegroupsubset: more renaming 2011-03-20 19:43:28 -05:00
Matt Mackall
bd3182c8ff changegroupsubset: simplify prune
Ancestors of nodes linked to commonrevs can be expected to be linked
to commonrevs. Walking graphs of each revlog looking for rare/nonexistent outliers is overkill.
2011-03-20 19:43:28 -05:00
Matt Mackall
f97f8563d2 changegroupsubset: more minor cleanups
- remove more excessive comments
 - simplify some sorting operations
 - rename some variables
 - replace identity with a lambda
2011-03-20 19:43:28 -05:00
Matt Mackall
4e33ba22d8 changegroupsubset: minor cleanups
- move some variable declarations
 - drop some excessive comments
 - use standard variable naming
2011-03-20 19:43:28 -05:00
Matt Mackall
920f4c5db4 strip: simplify collectone 2011-03-20 19:43:28 -05:00
Greg Ward
4bcecd8160 dirstate: avoid a race with multiple commits in the same process
(issue2264, issue2516)

The race happens when two commits in a row change the same file
without changing its size, *if* those two commits happen in the same
second in the same process while holding the same repo lock.  For
example:

  commit 1:
    M a
    M b
  commit 2:           # same process, same second, same repo lock
    M b               # modify b without changing its size
    M c

This first manifested in transplant, which is the most common way to
do multiple commits in the same process. But it can manifest in any
script or extension that does multiple commits under the same repo
lock. (Thus, the test script tests both transplant and a custom script.)

The problem was that dirstate.status() failed to notice the change to
b when localrepo is about to do the second commit, meaning that change
gets left in the working directory. In the context of transplant, that
means either a crash ("RuntimeError: nothing committed after
transplant") or a silently inaccurate transplant, depending on whether
any other files were modified by the second transplanted changeset.

The fix is to make status() work a little harder when we have
previously marked files as clean (state 'normal') in the same process.
Specifically, dirstate.normal() adds files to self._lastnormal, and
other state-changing methods remove them. Then dirstate.status() puts
any files in self._lastnormal into state 'lookup', which will make
localrepository.status() read file contents to see if it has really
changed.  So we pay a small performance penalty for the second (and
subsequent) commits in the same process, without affecting the common
case.  Anything that does lots of status updates and checks in the
same process could suffer a performance hit.

Incidentally, there is a simpler fix: call dirstate.normallookup() on
every file updated by commit() at the end of the commit.  The trouble
with that solution is that it imposes a performance penalty on the
common case: it means the next status-dependent hg command after every
"hg commit" will be a little bit slower.  The patch here is more
complex, but only affects performance for the uncommon case.
2011-03-20 17:41:09 -04:00
Benoit Boissinot
5d27fc0ccb changegroupsubset: extranodes are no longer needed 2011-03-20 01:16:57 +01:00
Benoit Boissinot
66804f4889 strip: remove usage of extranodes
Instead of computing the exact set of missing revlog revisions, we only
compute the set of missing/broken changesets. The resulting bundle can be
slightly bigger but we will be able to get rid of the ugly extranodes handling
in changegroupsubset.
2011-03-20 00:50:22 +01:00
Patrick Mezard
1597f620c9 patch: move closefile() into patchfile.close() 2011-03-20 00:22:47 +01:00
Patrick Mezard
189b71bbde patch: inline patchfile.hashlines() 2011-03-20 00:09:44 +01:00
Patrick Mezard
6a59fcba00 patch: fix hunk newlines when parsing hunks, not in iterhunks() 2011-03-20 00:08:44 +01:00
Matt Mackall
ca9fdc1884 annotate: catch nonexistent files using match.bad callback (issue1590) 2011-03-19 01:34:49 -05:00
Matt Mackall
9bb3fa8c69 merge with stable 2011-03-17 17:08:13 -05:00
Miloš Hadžić
b3d3d7aa76 push/outgoing: print remote target path even if there's an error (issue2561)
This is a simple patch to make hg push/hg outgoing print their remote target
path even if the operation fails. I'm not sure if the original behavior was by
design.

This patch also changes one test to reflect the changed behaviour.
2011-03-17 22:55:02 +01:00
Eric Eisner
3cc72a297f subrepo: recognize scp-style paths as git URLs 2011-03-17 16:29:09 -04:00
Markus F.X.J. Oberhumer
489871ea69 revset: fix a number of highly dubious continue statements
This patch definitely needs a review and would also benefit from
some new testsuite entries.
2011-03-16 23:54:55 +01:00
Markus F.X.J. Oberhumer
c2ca636151 archive: use hardcoded constants when creating .zip archives
Do not rely on local stat constants, which may differ.
2011-03-16 23:54:55 +01:00
timeless
81c1d7fc8b hgweb: support multiple directories for the same path
[paths]
/dir = /path/1/*, /path/2/*
2011-03-16 03:06:57 +01:00
timeless
56241a1f0c templates: provide granularity for future values for age filter 2011-03-16 03:28:56 +01:00
Bernhard Leiner
baf797018e revset: report a parse error if a revset is not parsed completely (issue2654) 2011-03-16 23:09:14 +01:00
Adrian Buehlmann
c639e13569 config: use util.posixfile 2011-03-16 18:48:59 +01:00
Matt Mackall
c989b5dd89 merge: avoid unlinking destination of merge when case changes (issue2715) 2011-03-22 12:00:38 -05:00
Matt Mackall
c6bc26dacb dirstate: introduce a public case normalizing method 2011-03-22 11:59:43 -05:00
David Soria Parra
10510a0de1 bundle: update current bookmark to most recent revision on current branch
We check if the current bookmark is set to the first parent of the
dirstate. Is this the case we move the bookmark to most recent revision
on the current branch (where hg update will update you to).
2011-03-14 23:03:56 +01:00
David Soria Parra
848c5155b1 localrepo: do not update bookmarks in addchangegroup
We want to update the current bookmark to the most recent revision on
current branch unless there is a remote bookmark that points to
a different descendant. Addchangegroup is called before we can check for
remote bookmarks.

We don't update the bookmark in addchangegroup anymore to allow proper updating
of bookmarks in pull.
2011-03-14 20:53:55 +01:00
David Soria Parra
a43d669108 bookmarks: remove API limitation in setcurrent
setcurrent refuses to set a new current bookmark if the current bookmark
points to the current dirstate. This restriction is not needed. A current
bookmark can point to a different bookmark.
2011-03-14 09:36:17 +01:00
David Soria Parra
4e5087c547 bookmarks: separate bookmarks update code from localrepo's pull.
We explicitly want to update bookmarks from a remote. This will avoid
duplicate calls to listkeys if we clone (which calls pull) and keep
bookmark related code together.
2011-03-14 00:10:43 +01:00
Nils Adermann
8a18a9288e identify: list bookmarks for remote repositories 2011-03-12 18:15:14 +01:00
Matt Mackall
cc6de8544b hgweb: drop use of super() for Exception base class
In Python 2.4, Exception is an old-style class and doesn't work with super.
2011-03-14 15:28:56 -05:00
Steve Borho
89afb35fbf diff: make diff -c aware of revision sets 2011-03-14 13:11:26 -05:00