Commit Graph

22151 Commits

Author SHA1 Message Date
Augie Fackler
1797298fcf cvsps: add two more tiebreakers in cscmp
test-convert-cvs.t has been a little flaky for a while now. Add an
extra tiebreaker in cscmp so that all the cases in the test will sort
reliably.

Without this patch, test-convert-cvs.t failed after 346 runs. With
this patch, I stopped trying to get it to fail after 615 runs. While
not conclusive, that makes me pretty optimistic that this is a working
fix.
2014-08-21 10:07:30 -04:00
Yuya Nishihara
0d0228f451 annotate: abort early if no file is specified
This change is intended to move the getdate function near the opmap table.
2014-08-16 17:59:26 +09:00
Siddharth Agarwal
cbca8f558d purge: avoid full walks when directories aren't purged
If match.traversedir is not None, we're forced to do full walks. However when
we aren't purging directories we don't need to set match.traversedir to
anything.

This speeds up non-full walks such as the one hgwatchman makes possible. For
mozilla-central with hgwatchman enabled, 'hg purge --files' goes from 0.88
seconds to 0.22.
2014-08-20 15:07:25 -07:00
Siddharth Agarwal
8f7105eac1 clone: for local clones, copy over filtered branchcaches as well (issue4286)
Local clones copy/hardlink over files directly, so the branchcaches should all
be valid. There's a slight chance that a read operation would update one of the
branchcaches, but we hold a lock over the source repo so they shouldn't cause
an invalid branchcache to be copied over, just a different, valid one.
2014-08-21 16:05:29 -07:00
Siddharth Agarwal
703f8d3ed8 clone: for local clones, copy branchcache from the right location (issue4286)
The unfiltered branchcache is in .hg/cache/branch2, not
.hg/store/cache/branch2.
2014-08-21 15:58:32 -07:00
Augie Fackler
1705b23c44 obsolete: avoid 2-argument form of enumerate, which was new in Python 2.6 2014-08-20 14:33:59 -04:00
Augie Fackler
cceb152b73 repoview: use util.sha1() instead of hashlib.sha1()
6f2e3119e8a1 accidentally broke Python 2.4 compatibility, this fixes it.
2014-08-20 13:21:41 -04:00
Pierre-Yves David
1119f2b21b debugobsolete: display parents information from markers
Now that we have a new field, we need a way to visualize it.
2014-08-18 17:17:23 -07:00
Pierre-Yves David
d03cabd953 obsmarkers: add a parentnodes method to retrieve parent information 2014-08-18 17:14:27 -07:00
Pierre-Yves David
fd1f0f7321 obsstore: also store the 'parents' field on disk
We now store the `parents` field on disk. We use the same strategy as for
`date`: We stick it into the metadata. This is slow and dirty, but this is also
the only way we currently have.

At some point we'll have a new obsstore format to store this properly.
2014-08-18 16:28:44 -07:00
Pierre-Yves David
41733331bc obsstore: drop 'date' from the metadata dictionary
We are extracting the `date` information from the metadata at read time.
However, we failed to remove it from the metadata returned in the markers. This
is now fixed.
2014-08-18 17:06:08 -07:00
Pierre-Yves David
c584b9c277 createmarkers: automatically record the parent of pruned changesets
We need this information to build the set of relevant markers during
exchanges. This can only be done at the `createmarkers` level since
the `obsstore.create` function does not have a repo and therefore has
no access to the parent information.
2014-08-18 16:17:16 -07:00
Pierre-Yves David
767b2c8f0d obsstore: add a parents argument to obsstore.create
We need a way to pass the information to the function. Some guru told me that
what's arguments are made for.
2014-08-18 16:12:29 -07:00
Pierre-Yves David
95fa5b1577 obsstore: add a parents field
This field is intended to store the parent of the precursor. This is useful to
attach pruned changesets to a set of exchanged changesets. We currently just
add the fields with a None value. None stands for "no data recorded".
2014-08-18 16:08:44 -07:00
Pierre-Yves David
21ceed5f91 obsstore: add some documentation about the marker fields
As the number of fields grow, it makes sense to start documenting their contents.
2014-08-19 14:42:08 -07:00
FUJIWARA Katsunori
67129a7816 transplant: change "editform" to distinguish merge commits from others
"editform" argument for "getcommiteditor" is decided according to the
format below:

  EXTENSION[.COMMAND][.ROUTE]

  - EXTENSION: name of extension
  - COMMAND: name of command, if there are two or more commands in EXTENSION
  - ROUTE: name of route, if there are two or more routes in COMMAND

This patch newly adds "normal" and "merge" as ROUTE, to distinguish
merge commits from other.

This patch adds 4 test patterns to test combination of "merge"(x2) and
"--continue"(x2).
2014-08-16 10:43:59 +09:00
FUJIWARA Katsunori
7a8c1645ce rebase: change "editform" to distinguish merge commits from others
"editform" argument for "getcommiteditor" is decided according to the
format below:

  EXTENSION[.COMMAND][.ROUTE]

  - EXTENSION: name of extension
  - COMMAND: name of command, if there are two or more commands in EXTENSION
  - ROUTE: name of route, if there are two or more routes in COMMAND

This patch newly adds "merge" as ROUTE, to distinguish merge commits
from other.

This patch passes bool as "ctxorbool" to "mergeeditform", because
working context has always 2 parents at this point. Dropping the
second parent of non-merging commits is executed in "concludenode".

Unlike other patches in this series (e.g. for "hg commit"), this patch
doesn't add "normal.normal"/"normal.merge" style ROUTEs, because there
is no "merge" case in "collapse" ROUTE.
2014-08-16 10:43:59 +09:00
FUJIWARA Katsunori
6ff720dff7 import: change "editform" to distinguish merge commits from others
"editform" argument for "getcommiteditor" is decided according to the
format below:

  COMMAND[.ROUTE]

  - COMMAND: name of command
  - ROUTE: name of route, if there are two or more routes in COMMAND

This patch uses "normal.normal" and "normal.merge" as ROUTE of
"editform" instead of "normal", to distinguish merge commits from
other in "hg import" without "--bypass" case.

This patch assumes "editform" variations for "hg import" below:

    import.normal.normal
    import.normal.merge
    import.bypass.normal
    import.bypass.merge

Unlike other patches in this series, this patch uses "editor.sh"
instead of "checkeditform.sh" for the name of the script to check
"HGEDITFORM", because it has to do more than checking "HGEDITFORM".

To invoke editor forcibly in "test-import-merge.t", this patch creates
the patch not having patch description as "merge.nomsg.diff".
2014-08-16 10:43:59 +09:00
FUJIWARA Katsunori
1d0310bb6c commit: change "editform" to distinguish merge commits from other (--amend)
"editform" argument for "getcommiteditor" is decided according to the
format below:

  COMMAND[.ROUTE]

  - COMMAND: name of command
  - ROUTE: name of route, if there are two or more routes in COMMAND

This patch uses "amend.normal" and "amend.merge" as ROUTE of
"editform" instead of "amend", to distinguish merge commits from other
in "hg commit --amend" case.
2014-08-16 10:43:59 +09:00
FUJIWARA Katsunori
df8f4a6663 commit: change "editform" to distinguish merge commits from others
"editform" argument for "getcommiteditor" is decided according to the
format below:

  COMMAND[.ROUTE]

  - COMMAND: name of command
  - ROUTE: name of route, if there are two or more routes in COMMAND

This patch uses "normal.normal" and "normal.merge" as ROUTE of
"editform" instead of "normal", to distinguish merge commits from
others in "hg commit" without "--amend" case.

This patch assumes "editform" variations for "hg commit" below:

    commit.normal.normal
    commit.normal.merge
    commit.amend.normal
    commit.amend.merge

"mergeeditform" is factored out for subsequent patches. It takes
"ctxorbool" argument, because context object can't be passed in some
cases.
2014-08-16 10:43:59 +09:00
Gregory Szorc
d584614776 test-ssh: verify that stderr from remote is printed (issue4336)
The issue fixed in the previous patch was uncovered by implementing an
extension that printed additional output locally before the push command
completed. This test emulates that.

If this change is applied before the previous patch, the test will fail
on Linux, with the local output being printed before the "remote: "
lines.
2014-08-16 10:19:26 -07:00
Gregory Szorc
6799e4f38a posix: implement readpipe using non-blocking I/O (issue4336)
On Linux, fstat().st_size of a pipe always returns 0, even if the
pipe has data available for reading. This meant that reading from
and subsequently printing the stderr pipe content after wireproto
commands over SSH meant that available data wasn't being printed.

We now implement pipe reading on POSIX by doing a non-blocking
read for all available data.
2014-08-16 10:28:59 -07:00
Gregory Szorc
db57d5e9d6 platform: implement readpipe()
Reading all available data from a pipe has a platform-dependent
implementation.

This patch establishes platform.readpipe() by copying the
inline implementation in sshpeer.readerr(). The implementations
for POSIX and Windows are currently identical. The POSIX
implementation will be changed in a subsequent patch.
2014-08-15 20:02:18 -07:00
Pierre-Yves David
89e39a0c90 exchange: remove duplicated addition to pushop.stepdone
Not sure how it got there but it is useless.
2014-08-15 19:18:21 -07:00
Augie Fackler
ab198a5534 exchange: drop superfluous parens 2014-08-18 20:23:37 -04:00
Pierre-Yves David
a047d46203 push: add bookmarks to the unified bundle2 push
We use the `pushkey` part to exchange bookmark updates within the unified
bundle2 push. Note that this only applies on update (moving a bookmark known on both
sides) since bookmark export (creation of a new bookmark on remote) is apparently
done outside of the _push function.
2014-08-15 19:03:42 -07:00
Pierre-Yves David
4b35f98746 test-bundle2: add bookmark movement to the push test
If we add bookmarks to bundle2, we need a way to test the new code.
Tests are changed beforehand to highlight that inclusion of bookmarks in bundle
does not introduce any behavior changes.
2014-08-15 19:03:33 -07:00
Pierre-Yves David
698a1a6825 push: use stepsdone to control bookmark push
If bookmark are to be integrated in the unified bundle2, we need a way to disable
the old-style push.
2014-08-15 18:40:57 -07:00
Pierre-Yves David
f2ec8aebea push: move bookmark discovery with other discovery steps
The discovery of necessary bookmark updates is now done within the "discovery
phase". This opens the door to the inclusion of bookmarks in a unified bundle2
push.
2014-08-15 18:39:39 -07:00
Pierre-Yves David
1840ea298f pushbookmark: split an ultra-long line into a saner version
We make a temporary variable for the remote bookmark data and we do not expand
all elements from `bookmark.compare` since we are going to use only one.
2014-08-15 18:02:54 -07:00
Pierre-Yves David
6fc35a917d revert: drop dead code for untracked files
Untracked files are handled through status now.
2014-06-25 00:02:17 +01:00
Pierre-Yves David
6f03c922f1 revert: handle unknown files through status
This will allow us to drop the code dedicated to this special case.
2014-06-25 00:01:30 +01:00
Pierre-Yves David
aee89be787 revert: drop more dead code
Now that we detect all clean files, we do not need this clause anymore.
2014-06-24 23:55:43 +01:00
Pierre-Yves David
f409864957 revert: add a message to noop action
This prepares for the arrival of a second "not touching file" action:
revert of an untracked file.
2014-08-02 13:07:01 -07:00
Pierre-Yves David
5dc6cf75e9 revert: simplify loop conditional
The two breaks can be joined into one. The code gains one level of indent.
2014-08-01 11:41:56 -07:00
Pierre-Yves David
84467bf1a9 revert: explode the action tuple in the for loop
noop is about to gain a message.
2014-06-24 18:04:13 +01:00
Pierre-Yves David
110f9a614a revert: use actions[...] in all disptable cases
1. Special cases are not special enough

2. There are two cases where nothing is done and a message is displayed. This
   prepares it.
2014-08-02 12:45:34 -07:00
Pierre-Yves David
5b69082d6e revset: factorize backup decision
The conditional controlling the creation of backup is fairly big. We move config
related decisions outside of the loop.
2014-06-24 17:54:33 +01:00
Pierre-Yves David
8af395dddd revert: use a flat dispatch table
Now that the table is simpler, remove one level of depth from it. This
simplifies its usage in the for loop.
2014-06-24 17:44:31 +01:00
Pierre-Yves David
c881935cf8 pushbookmark: do not attempt to update bookmarks if the push failed (BC)
Before this patch, there was always an attempt to update bookmark even if prior
steps of the push failed. I cannot see a good semantic reason to do so. We
disable this possibility to simplify the push flow with bundle2. Bookmarks will
be included in the bundle and fail with other steps.
2014-08-15 18:26:21 -07:00
Pierre-Yves David
a6180e3cd6 pushbookmark: remove a <cond> and <val> or <other> construct
We make the conditional explicit for the sake of readability.
2014-08-15 17:58:15 -07:00
Pierre-Yves David
3727918ac1 pushbookmark: stop unrolling ancestors
Now that ancestors has the same boolean property as a list, we can stop unrolling
the set of ancestors. This should provide a significant speedup to this step as
ancestor objects are smart and lazy.
2014-08-15 16:31:06 -07:00
Pierre-Yves David
f84025d2b5 ancestors: add a __nonzero__ method
This allows using the object in a conditional the same way we can use list.
2014-08-15 15:57:50 -07:00
Pierre-Yves David
45e2e4b993 push: update bookmarks within the remote lock
Updating bookmarks is part of the push. It should be done within the same lock
as the other steps of the push.
2014-08-15 15:25:12 -07:00
Gregory Szorc
22de18c0d3 hgweb: refresh repository using URL not path (issue4323)
hgweb detects out-of-date repository instances (using a highly
suspect mechanism that should probably be fixed) and obtains a new
repository object if needed.

This patch changes the repository object copy to use the repo URL
(instead of path). This preserves more information about the source
repository and allows bundles to be served through hgweb.

A test verifying that bundles can now be served properly via
`hg serve` has been added.
2014-08-18 12:12:57 -07:00
Pierre-Yves David
3b78721608 obsmarker: add date as an explicit field
The markers are now 5-item tuples (concluded by the date). The obsstore.fields
contents have been updated accordingly.

There is no change to the on-disk format yet, so the date has to be extracted
every time we read binary markers and re-injected each team we write them. This
introduces a slowdown that will be solved when a new version of the format is
added. Such a slowdown was already introduced by the evolve extension anyway.
2014-08-19 10:01:06 -07:00
Pierre-Yves David
971ae35ea3 obsstore: add fields attribute to track each field in a marker
We are going to increase the amount of data explicitly stored in obsolescence
markers. This mean we are going to have a longer tuple and some values will be
shuffled around. So we add a ``fields`` attribute to the obsstore class to
keep track of what entry is what. This will be useful for extensions and for
documentation purpose.
2014-08-12 01:49:38 -07:00
Pierre-Yves David
a3e6a74916 debugobsolete: explicitly display date in the output
As the date is becoming a first-class citizen, we are displaying it in an
explicit field. As a bonus it is now readable by humans.
2014-08-13 23:42:36 -07:00
Pierre-Yves David
f43f2ce984 obsolete: add a date argument to the createmarkers function
The function is now just passing the value to create markers.
2014-08-14 12:59:48 -07:00
Pierre-Yves David
7fc91f5ad7 debugobsolete: use the new date argument on obsstore.create
Now that we have this new argument, we can just use it.
2014-08-13 23:25:07 -07:00