Commit Graph

22976 Commits

Author SHA1 Message Date
Martin von Zweigbergk
c20daf914f strip: make checklocalchanges() return full status tuple
By making checklocalchanges() return the full instance of the status
class instead of just the first 4 elements of it, we can take
advantage of the field names and not require the caller to remember
the element indices.
2014-10-04 20:53:05 -07:00
Martin von Zweigbergk
05e97c1d55 fileset: access status fields by name rather than index 2014-10-04 21:58:01 -07:00
Martin von Zweigbergk
c8176c1f40 histedit: access status fields by name rather than index 2014-10-04 21:19:44 -07:00
Martin von Zweigbergk
7287633c8c shelve: access status fields by name rather than index 2014-10-03 22:12:43 -07:00
Martin von Zweigbergk
5ea3a9fbd3 record: access status fields by name rather than index
It is safe to pass the full status to patch.diff() since it does its
own slicing.
2014-10-03 10:44:07 -07:00
Martin von Zweigbergk
cb32fc3c29 purge: access status fields by name rather than index 2014-10-03 10:38:43 -07:00
Martin von Zweigbergk
6f453479df largefiles: access status fields by name rather than index 2014-10-03 22:10:08 -07:00
Martin von Zweigbergk
2565ab5473 keyword: access status fields by name rather than index 2014-10-03 10:05:54 -07:00
Martin von Zweigbergk
477ec46ab8 hgcia: access status fields by name rather than index 2014-10-03 09:51:39 -07:00
Martin von Zweigbergk
011cf39cde context: store status class instead of plain tuple in self._status
This improves readability a bit by allowing us to refer to statuses by
name rather than index.
2014-10-04 21:05:41 -07:00
Martin von Zweigbergk
8b968ecfe2 status: update and move documentation of status types to status class
The various status types are currently documented on the
dirstate.status() method. Now that we have a class for the status
types, it makese sense to document the status types there
instead. Only leave the bits related to lookup/unsure in the status()
method documentation.
2014-10-10 10:14:35 -07:00
Martin von Zweigbergk
8961a5a15c status: update various other methods to return new class 2014-10-14 00:52:27 -05:00
Martin von Zweigbergk
41a4138ec7 status: create class for status lists
Callers of various status() methods (on dirstate, context, repo) get a
tuple of 7 elements, where each element is a list of files. This
results in lots of uses of indexes where names would be much more
readable. For example, "status.ignored" seems clearer than "status[4]"
[1]. So, let's introduce a simple named tuple containing the 7 status
fields: modified, added, removed, deleted, unknown, ignored, clean.

This patch introduces the class and updates the status methods to
return instances of it. Later patches will update the callers.

 [1] Did you even notice that it should have been "status[5]"?

(tweaked by mpm to introduce the class in scmutil and only change one user)
2014-10-10 14:32:36 -07:00
Martin von Zweigbergk
0daa605421 lfutil: avoid creating unnecessary copy of status tuple
In lfdirstatestatus(), the status tuple gets deconstructed, the lists
get updated, and then an identical status tuple gets created and
returned. Change it so we simply return the original tuple.
2014-10-03 21:21:20 -07:00
Martin von Zweigbergk
1a4e0a3d51 dirstate: separate 'lookup' status field from others
The status tuple returned from dirstate.status() has an additional
field compared to the other status tuples: lookup/unsure. This field
is just an optimization and not something most callers care about
(they want the resolved value of 'modified' or 'clean'). To prepare
for a single future status type, let's separate out the 'lookup' field
from the rest by having dirstate.status() return a pair: (lookup,
status).
2014-10-03 21:44:10 -07:00
Martin von Zweigbergk
ff5a03e917 commit: update file nodeid and flags in the same place
Now that we have a separate variable for the original 'm1' manifest,
we can safely update the nodeid of the file in the new manifest in the
same place as we update the flags.
2014-10-13 14:18:47 -07:00
Martin von Zweigbergk
00bbada8de commit: use separate variable for p1 manifest and new manifest
In localrepo.commitctx(), p1's manifest is copied and used as the
basis for the manifest that is about to be committed. The way the copy
is updated makes it safe to use it where the original p1's manifest is
wanted. For readability, though, a separate variable for each purpose
would be clearer. Make it so.
2014-10-13 14:11:47 -07:00
Martin von Zweigbergk
d74577dbf4 commit: remove dead initialization of 'lock'
The 'lock' variable is initialized to None, but before it's ever read,
it's assigned again.
2014-10-13 14:34:53 -07:00
Martin von Zweigbergk
28d3f795f0 commit: reduce scope of 'removed' variable
The variable is closely related to 'added' and 'changed', so it makes
sense to have it declared next to them.
2014-10-13 16:43:37 -07:00
Matt Mackall
7872571fea rebase: fix some weird mixed-case naming 2014-10-13 18:00:39 -05:00
Matt Mackall
f3ce636a9c rebase: move duplicatecopies next to merge
This is preparation for removing open-coded rebase/graft operations.

As a side-effect, this exposes proper renames in the working copy when
there are conflicts, which shows up in test-shelve.t.
2014-10-13 17:55:45 -05:00
Matt Mackall
a61dbef490 histedit: use merge.graft 2014-10-13 17:12:47 -05:00
Matt Mackall
74cbfe3cf7 graft: use merge.graft 2014-10-13 17:12:31 -05:00
Matt Mackall
0327807819 merge: add merge.graft helper
This will help unify all the open-coded graft/rebase operations.
2014-10-13 17:12:12 -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
9286044a06 histedit: fix indent
The duplicatecopies call should be part of the rebase block.
2014-10-13 14:04:11 -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
Matt Mackall
9dcdad50d1 shelve: add a bundlerepo method 2014-10-10 13:44:40 -05:00
Matt Mackall
8e8234eecc dirstate: merge falls through to otherparent
This lets us more correctly fix the state when we use setparents, as
demonstrated in the change in test-graft.t.
2014-10-11 14:05:09 -05:00
Matt Mackall
f7a8e82c62 dirstate: use 'm' state in otherparent to reduce ambiguity
In rebase-like operations where we abandon the second parent, we can
correctly fix up the state in setparents.
2014-10-10 13:31:06 -05:00
Matt Mackall
a44416ab0f dirstate: properly clean-up some more merge state on setparents 2014-10-10 13:05:50 -05:00
Durham Goode
030db2699f phases: move root phase assignment to it's own function
This moves the initial root phase assignment to it's own function. Future
patches which make phase calculations lazy will use this function to pre-fill
certain phases which can be deduced from the roots.
2014-10-07 11:42:37 -07:00
Durham Goode
0d0869f7ae phases: add invalidate function
Phase cache invalidation was spread all over the place. Let's add a function to
unify it. Later more will be added to this function.
2014-10-07 11:37:54 -07: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
Pierre-Yves David
551481efc6 spanset: remove .set() definition
All my friends are dead.
2014-10-10 13:09:22 -07:00
Pierre-Yves David
cdaf453077 generatorset: remove .set() definition
All my friends are dead.
2014-10-10 13:08:49 -07:00
Pierre-Yves David
9531e16b0d addset: remove .set() definition
All my friends are dead.
2014-10-10 13:08:28 -07:00
Pierre-Yves David
f957be2403 filteredset: remove .set() definition
All my friends are dead.
2014-10-10 13:08:10 -07:00
Pierre-Yves David
fcdeb29add baseset: remove set() definition
All my friends are dead.
2014-10-10 13:07:35 -07:00
Pierre-Yves David
a9fcdb25c5 abstractsmartset: remove set() method definition
Now that all usages have been removed, we can drop this not so useful part of
the API. We can note that the name was wrong all along...
2014-10-10 11:27:57 -07:00
Pierre-Yves David
70851c278d match: check if an object is a baseset using isascending instead of set
The `set()` method is going away.
2014-10-10 14:27:05 -07:00
Pierre-Yves David
0de25934dc getset: check if an object is a baseset using isascending instead of set
The `set()` method is going away.
2014-10-10 14:22:23 -07:00
Pierre-Yves David
c249a728eb fullreposet: detect smartset using "isascending" instead of "set"
The `.set()` function is going away.
2014-10-10 13:24:57 -07:00
Pierre-Yves David
be86e2f6f1 fullreposet: drop custom sets but not smartsets detection
All custom classes use by revsets are smartsets now. We drop the special-casing.
2014-10-10 13:21:05 -07:00
Pierre-Yves David
e0b5b0a127 addset: drop .set() usage during iteration
We can use the containment check directly.
2014-10-10 12:30:00 -07:00
Pierre-Yves David
efff35ee9d baseset: access _set directly for containment check
The `.set()` method is going away.
2014-10-10 12:31:22 -07:00
Pierre-Yves David
5049b858d9 baseset: make _set a property cache
This will remove the need for `baseset.set()`.
2014-10-10 12:30:56 -07:00
Pierre-Yves David
544d621b98 graphnode: remove usage of set()
All smartset classes have fast lookup, so this function will be removed soon.
2014-10-10 11:27:04 -07:00
Pierre-Yves David
a54d940320 revset-_hexlist: remove usage of set()
All smartset classes have fast lookup, so this function will be removed soon.
2014-10-08 02:52:10 -07:00
Pierre-Yves David
76a0476bf7 revset-_intlist: remove usage of set()
All smartset classes have fast lookup, so this function will be removed soon.
2014-10-08 02:51:54 -07:00