Commit Graph

455 Commits

Author SHA1 Message Date
Sean Farley
cdafec8fc5 committablectx: move status to workingctx
This method was accidentally placed into the committablectx class. It contains
logic for querying the dirstate so we move it to the correct class.
2014-03-11 18:28:09 -05:00
Sean Farley
df1d7f2500 localrepo: factor out parentworking logic for comparing files
We will temporarily call a private method of the context class while we are in
the process of removing the need of having localrepo.status.
2014-03-11 18:10:00 -05:00
Sean Farley
0df8cdd414 localrepo: move symlink logic to workingctx 2014-03-07 13:32:37 -08:00
FUJIWARA Katsunori
a569398722 context: move editor invocation from "makememctx()" to "memctx.__init__()"
This patch introduces "editor" argument to "memctx.__init__()", and
moves editor invocation from "makememctx()" to "memctx.__init__()", to
centralize editor invocation into "memctx" object creation.

This relocation is needed, because "makememctx()" requires the "store"
object providing "getfile()" to create "memfilectx" object, and this
prevents some code paths from using "makememctx()" instead of
"memctx.__init__()".

This patch also invokes "localrepository.savecommitmessage()", when
"editor" is specified explicitly, to centralize saving commit message
into "memctx" object creation: passing "cmdutil.commiteditor" as
"editor" can achieve both suppressing editor invocation and saving
into ".hg/last-message.txt" for non empty commit messages.
2014-05-05 21:26:40 +09:00
Matt Mackall
8ba0348c31 ancestor: silence multiple ancestor warning outside of merge (issue4234)
The current situation is a bit of a layering violation as
merge-specific knowledge is pushed down to lower layers and leaks
merge assumptions into other code paths.

Here, we simply silence the warning with a hack. Both the warning and
the hack will probably go away in the near future when bid merge is
made the default.
2014-04-30 14:19:01 -05:00
Mads Kiilerich
cdb11ac02d context: introduce merge.preferancestor for controlling which ancestor to pick
Multiple revisions can be specified in merge.preferancestor, separated by
whitespace. First match wins.

This makes it possible to overrule the default of picking the common ancestor
with the lowest hash value among the "best" (introduced in f19507e1bcf2).

This can for instance help with some merges where the 'wrong' ancestor is used.
There will thus be some overlap between this and the problems that can be
solved with a future 'consensus merge'.

Mercurial will show a note like
  note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
        alternatively, use --config merge.preferancestor=0f6b37dbe527
when the option is available, listing all the alternative ancestors.
2014-02-24 22:42:14 +01:00
Mads Kiilerich
81feeb72af context: tell when .ancestor picks one of multiple common ancestors heads
Show a message like
  note: using 0f6b37dbe527 as ancestor of adfe50279922 and cf89f02107e5

So far this is just a warning - there is nothing the user can do to select
another ancestor.
2014-04-17 17:32:04 +02:00
Mads Kiilerich
c608411f0d context: remove redundant handling of match.bad return value
The 'bad' function is for reporting - it never returns anything.
2013-10-03 18:01:21 +02:00
Mads Kiilerich
c951e7f8b6 context: remove unused filectx.ancestor 2014-04-07 23:17:48 +02:00
Augie Fackler
550a17aab3 context: add a getfileset() method so fewer things need fileset directly
Allows me to break an import cycle in a subsequent change.
2014-02-04 15:27:49 -05:00
Durham Goode
ffaaebd787 changectx: increase perf of walk function
When running 'hg cat -r . <file>' it was doing an expensive ctx.walk(m) which
applied the regex to every file in the manifest.

This changes changectx.walk to iterate over just the files in the regex, if no
other patterns are specified. This cuts hg cat time by 50% in our repo and
probably benefits a few other commands as well.
2014-01-14 13:49:19 -08:00
Mads Kiilerich
48b69add79 context: drop caching 'copies' method
The 'copies' method has no test coverage and calls copies.pathcopies with an
incorrect number of parameters and is thus (fortunately) not used. Kill it.
2013-11-16 15:46:29 -05:00
Augie Fackler
fb91efd733 makememctx: move from patch to context to break import cycle 2013-11-06 22:09:15 -05:00
Mads Kiilerich
eabc047878 spelling: random spell checker fixes 2013-10-24 01:49:56 +08:00
FUJIWARA Katsunori
52c2363e13 context: use "vfs.lstat()" to examine target path instead of "os.path.*"
This patch gets stat object of target path by "vfs.lstat()", and
examines stat object to know the type of it. This follows the way in
"workingctx.add()".

This should be cheaper than original implementation invoking
"lexists()", "isfile()" and "islink()".
2013-10-15 00:51:05 +09:00
FUJIWARA Katsunori
269961e114 context: use "vfs.lstat()" instead of "os.lstat()" 2013-10-15 00:51:04 +09:00
FUJIWARA Katsunori
770590e67f context: use "vfs.lstat()" instead of "os.lstat()"
This patch also changes paths added to "rejected" list from full path
(referred by "p") to relative one (referred by "f"), when type of
target path is neither file nor symlink.

This change should be reasonable, because the path added to "rejected"
list is relative one, when "OSError" is raised at "lstat()".
2013-10-15 00:51:04 +09:00
Sean Farley
89ec93306f context: move evolution functions from changectx to basectx
This is just a code move and corrects an overlook from my previous patch series
that assumed only a changectx would want this functionality.
2013-09-17 23:34:57 -05:00
Sean Farley
58d5c3fd06 context: use correct spelling of committable 2013-09-17 18:34:45 -05:00
Sean Farley
f65ef721e4 commitablefilectx: move children from workingfilectx 2013-08-15 13:42:56 -05:00
Sean Farley
f415142833 commitablefilectx: move parents from workingfilectx 2013-08-15 13:42:33 -05:00
Sean Farley
f31ebd758d commitablefilectx: move __nonzero__ from workingfilectx 2013-08-15 13:23:06 -05:00
Sean Farley
f38f187cbc commitablefilectx: move __init__ from workingfilectx 2013-08-15 13:12:50 -05:00
Sean Farley
608e9a1f09 commitablefilectx: add a class that will be used for mutable file contexts
Just like commitablectx, this will serve as a common place for code that will
be shared between workingfilectx and memfilectx.
2013-08-15 13:11:51 -05:00
Sean Farley
be4c3801e7 commitablectx: move dirs from workingctx 2013-08-14 16:40:34 -05:00
Sean Farley
e88dd1aaed commitablectx: move markcommitted from workingctx 2013-08-14 16:40:27 -05:00
Sean Farley
63bb66d577 commitablectx: move ancestors from workingctx 2013-08-14 16:37:59 -05:00
Sean Farley
402e7ea991 commitablectx: move walk from workingctx 2013-08-14 16:37:11 -05:00
Sean Farley
a895d35a4d commitablectx: move ancestor from workingctx 2013-08-14 16:37:01 -05:00
Sean Farley
72513aefb7 commitablectx: move flags from workingctx 2013-08-14 16:25:43 -05:00
Sean Farley
279f4b1ae7 commitablectx: move children from workingctx 2013-08-14 16:25:26 -05:00
Sean Farley
612da7c6bb commitablectx: move hidden from workingctx 2013-08-14 16:25:17 -05:00
Sean Farley
185f3bd11b commitablectx: move phase from workingctx 2013-08-14 16:24:59 -05:00
Sean Farley
03cb1762ec commitablectx: move bookmarks from workingctx 2013-08-14 16:24:33 -05:00
Sean Farley
286aebb4f4 commitablectx: move tags from workingctx 2013-08-14 16:24:16 -05:00
Sean Farley
2d15415c23 commitablectx: move extra from workingctx 2013-08-14 16:23:28 -05:00
Sean Farley
801497cf22 commitablectx: move closesbranch from workingctx 2013-08-14 16:23:16 -05:00
Sean Farley
a72a4edc59 commitablectx: move branch from workingctx 2013-08-14 16:23:02 -05:00
Sean Farley
8853002f4d commitablectx: move clean from workingctx 2013-08-14 16:22:42 -05:00
Sean Farley
c314be2c39 commitablectx: move ignored from workingctx 2013-08-14 16:22:32 -05:00
Sean Farley
32b922e204 commitablectx: move unknown from workingctx 2013-08-14 16:22:20 -05:00
Sean Farley
93bdfe006a commitablectx: move deleted from workingctx 2013-08-14 16:21:55 -05:00
Sean Farley
fe6d82e931 commitablectx: move removed from workingctx 2013-08-14 16:15:29 -05:00
Sean Farley
eba15bc142 commitablectx: move added from workingctx 2013-08-14 16:15:18 -05:00
Sean Farley
ecee868f25 commitablectx: move modified from workingctx 2013-08-14 16:14:58 -05:00
Sean Farley
cc0f5b38da commitablectx: move files from workingctx 2013-08-14 16:09:45 -05:00
Sean Farley
a8af5db123 commitablectx: move description from workingctx 2013-08-14 16:09:30 -05:00
Sean Farley
d3e48b9c15 commitablectx: move date from workingctx 2013-08-14 16:03:32 -05:00
Sean Farley
e01ebdbeaa commitablectx: move _date from workingctx 2013-08-15 10:57:43 -05:00
Sean Farley
ee2b1a6d19 commitablectx: move user from workingctx 2013-08-14 15:57:24 -05:00