Commit Graph

22109 Commits

Author SHA1 Message Date
Matt Mackall
9bc396577d repoview: fix 0L with pack/unpack for 2.4 2014-08-26 13:11:53 +02:00
Mike Edgar
7d4f56ed60 histedit: use str.startswith to check for comments in action list 2014-08-22 16:40:34 -04:00
Mike Edgar
f32b610c93 histedit: drop duplicate line extracting keep option 2014-08-22 16:37:55 -04:00
FUJIWARA Katsunori
baa5c6430a import: avoid editor invocation when importing with "--exact" for exact-ness
Before this patch, external editor is invoked when imported patch has
no commit message, even if "--exact" is specified. Then, exact-ness is
broken, because empty commit message causes failure of committing.

This patch avoids editor invocation at importing with "--exact" for
exact-ness, because commit message in the patch should be kept as it
is in such case, even if it is empty.
2014-08-23 23:03:50 +09:00
FUJIWARA Katsunori
ba4ea74b2b import: disallow meaningless combination of "--exact" and "--edit"
Before this patch, "hg import" allows combination of "--exact" and
"--edit", even though editing commit message breaks exact-ness.

This patch disallows meaningless combination of "--exact" and "--edit".
2014-08-23 23:03:50 +09:00
Razvan Cojocaru
e0ffeec97b config: highlight parse error caused by leading spaces (issue3214)
Added "unexpected leading whitespace" message to parse error
when .hgrc has a line that starts with whitespace.
Helps new users unfamiliar with syntax of rc file.
2014-03-16 17:31:31 +02:00
Pierre-Yves David
6a8008b5cd test-config: add tests for invalid syntax
This was not tested and there is more to come in the next patch.
2014-08-20 22:52:56 -07:00
Pierre-Yves David
dfccc53b1c debugobsolete: add a --rev argument
This argument can be used to list markers relevant to a set of revisions. We
add a test for this option and the relevant computation in the same move.
2014-08-19 23:22:44 -07:00
Pierre-Yves David
e3efc0de1b obsolete: rename allmarkers to getmarkers
This function is going to gain a "nodes" argument to filter the markers to the
ones relevant to <nodes> only.
2014-08-20 18:11:23 -07:00
Pierre-Yves David
4a696375af debugobsolete: add a way to record parent information
We add a ``--record-parents`` flag to debugobsolete. This can be used to record
parent information in the marker when the precursors are known locally. This
will be useful to test the "relevant markers" computation.
2014-08-20 00:43:08 -07:00
Pierre-Yves David
9b224dd694 obsstore: add relevantmarkers method
We add a ``relevantmarkers`` method to fetch all markers that seem relevant to a
set of nodes. See function documentation about how this set is computed. This
will let us exchange only the markers that seem "relevant" to the set of
changesets related to a push or a pull.

The approach used to define "relevant" has been successfully tested in evolve
for 6 months.
2014-08-19 17:03:10 -07:00
Pierre-Yves David
4bdfd3c696 obsstore: keep track of children information
We use the new `parents` field to build a dictionary of markers that touch
children of a node. This will be used to link prune markers to a set of
exchanged nodes.
2014-08-19 16:53:53 -07:00
Pierre-Yves David
0e8c77f94c push: check if local and remote support evolution during discovery
We can now directly prevent any evolution-related operation from happening by using
an empty set for outgoing markers. So we detect if no transfers should occur and
use an empty set in this case.
2014-08-20 17:36:54 -07:00
Pierre-Yves David
72d4cdd2bd obsstore: drop outdated comment
This comment was associated with a now-defunct line.
2014-08-19 16:46:17 -07:00
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