Commit Graph

2684 Commits

Author SHA1 Message Date
Martin von Zweigbergk
6d828e9c66 resolve: run happily after conflict-free merge 2014-10-08 22:30:04 -07:00
Yuya Nishihara
11d619a47e cmdserver: switch service objects by mode
server class will be changed to accept fin/fout pair instead of mode string
so that it can interact with socket files.
2014-09-27 15:04:46 +09:00
Yuya Nishihara
84c7e5f2c1 cmdserver: wrap 'pipe' mode server by service object
This is the stub for new mode that will listen for connections on unix domain
socket.

Though --daemon option is not banned in 'pipe' mode, it is useless because
the detached 'pipe' mode server exits immediately due to null stdin. Should
it abort if --daemon is specified with --cmdserver pipe or --stdio?
2014-09-27 14:52:09 +09:00
Durham Goode
faa1c33f8b obsolete: add allowunstable option
This option allows the creation of unstable commits. This allows things like
amending in the middle of a stack of commits, etc.
2014-10-14 13:25:13 -07:00
Martin von Zweigbergk
85328e2d45 summary: make status code more readable
In commands.summary(), we currently zip a list of labels with a list
of statuses. This means the order of the status list has to match the
list of the labels, which in turn means the status elements have to be
inserted into specific places in the list. Let's instead group the
labels and status data we want to display in a single list of pairs.
2014-10-03 09:29:48 -07:00
Matt Mackall
74cbfe3cf7 graft: use merge.graft 2014-10-13 17:12:31 -05:00
Matt Mackall
f663e5fc01 duplicatecopies: move from cmdutil to copies
This is in preparation for moving its primary caller into merge.py,
which would be a layering violation in the current location.
2014-10-13 14:33:13 -05:00
Matt Mackall
32d16e5457 graft: move rebase cleanup code next to actual rebase
This is prep for refactoring the rebase logic.
2014-10-13 13:21:03 -05:00
Durham Goode
1b30e7ed86 phases: change phase command change detection
A future patch is going to make phase computation lazy, so the phase command can
no longer read and diff the entire phase list directly. This changes the phase
command to build it's own list for diff purposes.
2014-10-12 23:30:04 -07:00
Jordi Gutiérrez Hermoso
c978db634c config: use the same hgrc for a cloned repo as for an uninitted repo
This just copies the same local sample hgrc, except it sets the
default path to the repo it was cloned from.

This is cut-and-paste from the local sample hgrc, but I think it's
acceptable, since the two pieces of code are right next to each other
and they're small. There is danger of them going out of synch, but it
would complicate the code too much to get rid of this C&P.

I also add ui as an import to hg.py, but with demandimport, this
should not be a noticeable performance hit.
2014-10-06 16:35:02 -04:00
Pierre-Yves David
acbd681281 strip: stop calling remove on smartset
The `remove` method is not part of the smartset specification. We use a plain
old list comprehension instead.
2014-10-07 00:38:14 -07:00
Yuya Nishihara
5079a4aa16 bookmarks: port to generic templater 2014-10-03 00:43:22 +09:00
Yuya Nishihara
9ea06d6a89 bookmarks: split ui.write() so that it can be easily ported to formatter api
Test output changes because color labels are applied separately.
2014-10-03 00:36:36 +09:00
Yuya Nishihara
aa2e66b72c bookmarks: iterate bookmarks list even if it is known to be empty
This clarifies that "no bookmarks set" is displayed in addition to the list
of bookmarks.  In JSON output, for example, [] should be written if empty,
and "no bookmarks set" message should be skipped.
2014-10-03 00:15:39 +09:00
Yuya Nishihara
f415387791 branches: include active, closed and current flags in template output 2014-10-02 23:26:02 +09:00
Yuya Nishihara
ff85e4128c branches: merge white space to format string
Diffs of test output should be harmless.  A white space character is moved
into "log.changeset" color region.
2014-10-02 23:13:56 +09:00
Yuya Nishihara
690eb8ddf7 branches: port to generic templater 2014-10-02 22:59:56 +09:00
Yuya Nishihara
9d1844aa08 branches: format rev as integer that is necessary for generic templater 2014-10-02 22:15:39 +09:00
Yuya Nishihara
f7d73883e0 formatter: add general way to switch hex/short functions
This seems a bit awkward, but it can avoid duplicates in annotate, tags,
branches and bookmarks.

I guess fm.hexfunc can eventually be removed (or redesigned) when it gets
template backend.
2014-10-03 22:20:02 +09:00
Pierre-Yves David
f030469419 commands: directly use exchange.pull
localrepo.pull is going away. See explanations in 88d9d4ec499e.
2014-10-03 11:11:12 -05:00
Martin von Zweigbergk
7cb0d5dc0f summary: remove unused code for listing ignored files
The call to repo.status() does not request ignored files to be listed,
so remove the code for printing them.
2014-10-01 12:50:18 -07:00
Pierre-Yves David
627b3886af pull: move bookmark movements inside the exchange.pull
There is no reason for bookmarks to get a special treatment. As a first step we
move the code as is in the `exchange.pull` function. Integration with the rest
of the flow will come later.

Adding bookmarks to pull means that most clone paths are now pulling bookmarks
through pull. We ensure that bookmark-update messages are properly suppressed in
that case.

In test-pull-http.t the 'requesting all changes' message disappear because we
now get the authentication error on the `listkeys`command before such message
is printed.
2014-09-26 17:44:00 -07:00
Pierre-Yves David
c7f20ea1f1 pull: use other.url() as the source of a bookmark pull
We want to move the bookmarks movement into `exchange.pull`, for this purpose we
need to stop relying on variables from `command.pull`.
2014-09-26 10:59:29 -07:00
Yuya Nishihara
deb7a2b54f branches: reduce nesting in for loop 2014-10-02 21:58:10 +09:00
Mads Kiilerich
374f35aab5 templater: introduce templatepaths for getting paths searched for templates
Avoid function with different return types depending on parameters.
2014-09-28 16:57:37 +02:00
Pierre-Yves David
fa008917c9 pull: gather all bookmark-pulling code together
Pulling bookmarks is done in two rounds. First we do a simple update, then we use
the content of the `bookmark` argument to possibly overwrite some bookmark
with their remote location.

The second step was not done right after the first one for some obscure reason.
We now perform them one after the other.
2014-09-25 17:53:27 -07:00
Pierre-Yves David
4af2b1bb81 push: perform bookmark export in the push function
This part is responsible for adding new bookmarks on the remote.  Before that,
it was done on its own in `commands.push`. The export is still not integrated
with the rest of the push process, but at least it now dwells in the right
function.
2014-09-25 02:53:29 -07:00
Pierre-Yves David
90372104e5 push: pass list of bookmark to exchange.push
Currently stored but not unused. This parameter will control bookmarks explicitly
pushed (added to the server if missing).
2014-09-25 01:49:20 -07:00
Pierre-Yves David
7d3ee75e4d push: sanitize handling of bookmark push return value
Mixing return and assignment does not make sense, let's unify this.
2014-09-25 02:53:49 -07:00
Pierre-Yves David
dbad87edcd push: use exchange.push in commands.push
To gain access to all results from the push, we need to have access to the
`pushoperation` object. We call `exchange.push` to do so.

It is impossible to just change the `localrepo.push` signature because the
change may be too subtle to be caught by external extension wrapping
`localrepo.push`.

This mean we'll have to kill `localrepo.push` because just using
`exchange.push` in `commands.py` would silently disable all wrapping around
`localrepo.push` by third-party extensions. So we'll remove it in a later
changeset to get such extensions to fail noisily.
2014-09-25 01:39:39 -07:00
Siddharth Agarwal
f1c5684fc4 files: cache repo.dirstate
For a large repo, 'hg files' goes from 2.27 seconds to 1.92.
2014-09-30 16:01:19 -07:00
Siddharth Agarwal
41071b4456 files: only check for removed, not unknown or missing
ctx.matches() doesn't return unknown files, and repo.dirstate[f] never returns
'!' for an answer.
2014-09-30 15:21:35 -07:00
Siddharth Agarwal
fd44687dc1 files: use ctx.matches instead of ctx.walk
ctx.matches() is an optimized form of ctx.walk() when we don't care about the
state of files on disk.

For a large repo, 'hg files > /dev/null' drops from 3.7 seconds to 2.3.
2014-09-30 14:39:58 -07:00
Siddharth Agarwal
19c947e0ed files: actually filter out removed files
'hg files' makes an attempt to filter out removed files, but that doesn't work
because repo.dirstate[f] returns lowercase 'r', not uppercase.
2014-09-30 15:45:48 -07:00
Matt Mackall
e5c9cc0aaf help: basic support for showing only specified topic sections
For instance, 'hg help config.files' will show only the Files section.
2014-09-30 16:40:10 -05:00
Matt Mackall
34b0d3062c help: support OS-specific help sections
Containers of the form:

  .. container:: verbose.<os>

are shown by default on the given OS (or with -v).
2014-09-30 15:51:22 -05:00
Matt Mackall
275eb5bdd1 merge with stable 2014-09-29 17:23:38 -05:00
Matt Mackall
5f07bb0a47 help: fix typo in log examples 2014-09-29 16:42:12 -05:00
Matt Mackall
e3f89597c5 commands: add debuglocks to report/clear lock state 2014-09-26 16:44:11 -05:00
Yuya Nishihara
679696a5fe tags: use full hash for formatter output as in log or annotate commands 2014-09-21 12:50:48 +09:00
Yuya Nishihara
b70e3d719f tags: change field name of formatter output to be the same as log command
Since -T option is not public yet, this won't break backward compatibility.
2014-09-21 12:46:23 +09:00
Yuya Nishihara
40faa84ff9 files: correct topic of formatter 2014-09-21 12:38:47 +09:00
Matt Mackall
2f833205d7 help: mention mode in hg log --removed help (issue4381) 2014-09-21 10:31:34 -05:00
Aaron Kushner
c8faef4c5a config: exit non zero on non-existent config option (issue4247)
When running 'hg config no_such_option', hg exited with a
zero exit code. This change now exits with a 1 if the
config option does not exist.
2014-08-19 16:57:02 -07:00
Kevin Bullock
13972d0b4a bookmarks: refer to "the" active bookmark to clarify that there's only one
This is a follow-on to c6533daf7fc4 that just makes a slight clarification.
2014-08-30 15:13:02 +02:00
Mads Kiilerich
bb5bc3c743 graft: fix collision detection with origin revisions that are missing
When grafting something with a matching origin, it would normally be skipped:
  skipping already grafted revision 123 (23 also has origin 12)

But after stripping a graft origin, graft could fail with a reference to the
origin that no longer exists:
  abort: unknown revision '5c095ad7e90f871700f02dd1fa5012cb4498a2d4'!

Instead, detect that the origin is unknown and skip it anyway, like:
  skipping already grafted revision 8 (2 also has unknown origin 5c095ad7e90f871700f02dd1fa5012cb4498a2d4)
2014-08-27 15:30:09 +02:00
Pierre-Yves David
eed7417a2c debugobsolete: catch ValueError that may be raised by obsstore.create
There are already a couple of errors that obsstore.create can raise and we are
going to introduce a cycle check too.
2014-08-14 14:57:03 -07:00
Matt Mackall
f40cbba38d unbundle: fix pyflakes warning about wc 2014-08-11 13:10:00 -05:00
Matt Mackall
65d57189d4 unbundle: don't advance bookmarks (issue4322) (BC)
This behavior didn't make much sense and interacts badly with things
that use unbundle internally like shelve. Presumably, the original
rationale was that since bundles didn't contain bookmarks, this gave a
sense of keeping bookmarks up-to-date like would happen with a
corresponding pull. However, since it only updated the current active
bookmark, and bare update already did that anyway, this is pretty
slim.

Notably, the corresponding test actually works better without this
feature.
2014-08-10 23:09:23 -05:00
FUJIWARA Katsunori
97d5636e1b commands: make the warning message for "patch --partial" translatable
This patch makes the warning message for "patch --partial"
translatable: this message was introduced by a0ab8b02be69, and there is
no reason to prevent this from being translatable.
2014-08-01 02:14:24 +09:00