Commit Graph

803 Commits

Author SHA1 Message Date
Martin Geisler
c85f2356e3 subrepos: add function for iterating over ctx subrepos 2010-09-07 16:34:07 +02:00
Martin Geisler
5cb4b1f5eb subrepos: handle modified but uncommitted .hgsub 2010-09-07 16:23:55 +02:00
Martin Geisler
cb21fe1ac3 localrepo: check nested repos against working directory
This checks against what is really in the filesystem, including
subrepositories that have been added to .hgsub but not yet committed.
2010-09-07 15:31:56 +02:00
Martin Geisler
f2188b5b90 status: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Martin Geisler
bfa6c992eb localrepo: add auditor attribute which knows about subrepos 2010-09-03 12:58:51 +02:00
Martin Geisler
6a3762a95e commit: sort subrepos before committing for stable test output 2010-08-31 16:36:31 +02:00
Martin Geisler
cb36142754 Merge with stable 2010-08-29 22:55:37 +02:00
Martin Geisler
5f46f16fb7 Lowercase error messages 2010-08-29 22:37:58 +02:00
Georg Brandl
5a08641165 localrepo: introduce method for explicit branch cache update
Currently, localrepo.branchtags() is called in two locations to update the
_branchcache dict, however branchtags() itself does not update anything, it
calls branchmap() to do so. This change introduces a new updatebranchcache()
method that is used by both branchmap() and the calls to update the cache.
2010-08-28 23:57:39 +02:00
Patrick Mezard
6603319ceb repository: drop unused rjoin() method
This method was introduced by b0e5c3bce42a but grepping the history does not
reveal any call. Extensions may use it but the method intent is not even clear
to me.
2010-08-22 13:17:34 +02:00
Pradeepkumar Gayam
e2c89f7a97 localrepo: add parentdelta to requires only if enabled in config file 2010-08-10 22:28:08 +05:30
Nicolas Dumazet
064d677bd7 filectx: use cmp(self, fctx) instead of cmp(self, text)
This allows more flexibility in implementation, and in particular,
lets the context decide if revision text has to be loaded or not.
2010-07-27 23:40:46 +09:00
Nicolas Dumazet
055002dd11 localrepo: refactor filter computation
Separate loading part from access part to be able to tell with:
  repo._loadfilter(name)
  bool(name in repo.filterpats)
if there is a 'name' filter available.
2010-07-24 00:28:20 +09:00
Nicolas Dumazet
02750015e0 localrepo.status: move fixup concatenation inside if block for clarity
clean += fixup only makes sense if fixup is not empty; it should
be inside the "if fixup" test.
2010-07-25 10:05:38 +09:00
Benoit Boissinot
68e9051490 changegroup*(): use enumerate when possible 2010-07-24 00:15:29 +02:00
Benoit Boissinot
e8a7ae7259 changegroupsubset(): with the fix, prune() is actually useful in the testsuite 2010-07-24 00:03:19 +02:00
Benoit Boissinot
fc9a4ead97 changegroupsubset: simplify knownheads/has_cl_set computation 2010-07-23 00:04:18 +02:00
Benoit Boissinot
3914cfbfcd changegroupsubset(): ancestors() is not inclusive, we need to remove the "heads" 2010-07-22 23:54:57 +02:00
Benoit Boissinot
6fc1d6e96b changegroupsubset(): move comment at the right place 2010-07-22 23:44:14 +02:00
Benoit Boissinot
fec5f7c3d8 changegroupsubset(): refactor the prune() functions 2010-07-22 23:13:03 +02:00
Benoit Boissinot
c7e7cca544 changegroupsubset(): change variable names, simplify lookup logic 2010-07-22 16:51:45 +02:00
Benoit Boissinot
d2d26a535b changegroup(): used "linkrev" instead of "revlink" 2010-07-22 16:18:33 +02:00
Benoit Boissinot
1c069d50bd fix comment 2010-07-22 15:32:26 +02:00
Benoit Boissinot
27026ab37f changegroup*(): use set instead of dict 2010-07-22 14:34:37 +02:00
Nicolas Dumazet
517eb64655 merge with stable 2010-07-22 15:14:22 +09:00
Mads Kiilerich
f9b5838b6f init: create target directory recursively
Subrepos with relative paths must often be cloned to locations deep in the
directory structure. This allows clone over ssh (init+push) work.
2010-07-21 19:29:57 +02:00
Benoit Boissinot
8e7a94f166 changegroupsubset: remove unneeded cast to list 2010-07-16 18:35:15 +02:00
Benoit Boissinot
b4d92505c7 localrepo: remove push_{unbundle,addchangegroup}(), factor it inside push() 2010-07-16 13:38:33 +02:00
Matt Mackall
5e9649ad3b commit: add missing _() 2010-07-01 11:22:56 -05:00
Matt Mackall
5e2b0ca2ab subrepo: refuse to commit subrepos if .hgsub is excluded (issue2232) 2010-07-01 11:20:13 -05:00
Matt Mackall
e4cf775b71 addchangegroup: pass in lock to release it before changegroup hook is called
Currently, callers of addchangegroup first acquire the repository
lock, usually to check that an unbundle request isn't racing. This
means that changegroup hook actions that might write to a repo get
stuck waiting for a lock. Here, we add a new optional lock parameter
and update all the callers. Post-1.6 we may make it non-optional.
2010-06-25 13:47:28 -05:00
Matt Mackall
ae48625c19 pushkey: add localrepo support 2010-06-16 16:04:46 -05:00
Dirkjan Ochtman
af6b696f0f move working dir/dirstate methods from localrepo to workingctx 2010-06-07 20:03:32 +02:00
Dirkjan Ochtman
cf1de649bd move discovery methods from localrepo into new discovery module 2010-06-07 18:35:54 +02:00
Ronny Pfannschmidt
4362059a98 make transactions work on non-refcounted python implementations 2010-05-27 17:47:40 +02:00
Matt Mackall
e9152b864c Merge with stable 2010-05-28 16:01:57 -05:00
Matt Mackall
26c38ffe0e status: avoid performance regression when no .hgsub is present
(introduced by 3067d5de9e6c)
2010-05-28 14:41:11 -05:00
Sune Foldager
f9f5488566 push: add --new-branch option to allow intial push of new branches
Compare this to --force which allows anything to be pushed. With --new-branch,
only changesets to named branches not present on the and changesets not
introducing additional heads on existing branches are allowed.

Developed by
  Henrik Stuart <henrik.stuart@edlund.dk>
  Sune Foldager <cryo@cyanite.org>
2010-05-21 15:22:29 +02:00
Matt Mackall
a02b5a5fd1 commands: initial audit of exit codes
bisect: clarify None return
bundle: return 1 on no changes
clone: return result code
copy: limit errors to 0/1
commit: return 1 on no changes
forget: return 1 on errors
grep: return 1 if no match found
remove: return 1 on errors
resolve: return 1 if something fails to resolve
rollback: return 1 if no rollback data
2010-05-15 17:48:49 -05:00
Matt Mackall
3d7e1368a3 rollback: fix off-by-one in message 2010-05-13 17:36:45 -05:00
Matt Mackall
eb7971b34e Merge with stable 2010-05-11 17:03:44 -05:00
Greg Ward
89bd117131 push: document return values between various repo methods.
This starts at localrepository.push() and seeps down to
push_addchangegroup(), push_unbundle(), prepush(), addchangegroup(),
and leaks out to sshrepository.unbundle(), sshrepository.addchangegroup(),
and httprepository.unbundle().  Seems to cover everything you ever
wanted to know about pushing but were afraid to ask.
2010-05-02 21:56:25 -04:00
Edouard Gomez
293b104156 subrepo: print paths relative to upper repo root for push/pull/commit
This makes more sense when using multiple levels of
nesting.

This happens to help a lot in a case where 3 projects
of mine all use the same makefile helper project as a
sub. A fourth project use these first three projects
and current output made it very hard to figure
which makefile helper was committed. it looked more
like the project was committed/pushed/pulled three times
in a row than dealing on three different repos.
2010-05-01 23:05:22 +02:00
Nicolas Dumazet
22fdcb45f3 tag: warn users about tag/branch possible name conflicts
As reported recently, Mercurial users can easily find confusion when
using a common name for a tag and a branch. It seems reasonable to warn
them about this potential outcome, to avoid that "surprise".
* Explain briefly the issue in "hg help tag"
* Warn when tagging a revision
2010-04-19 17:41:12 +09:00
Eric Eisner
dd5c303d3f tags: return tags in sorted order
This makes log and summary have less arbitrary tag ordering and also
groups similar tags together, such as the mq tags.
2010-04-26 15:58:36 -04:00
Benoit Boissinot
5fb4657cce localrepo.commit: use explicit variables, avoid creating new contexts 2010-04-21 01:34:12 +02:00
Benoit Boissinot
a6309b7596 context: remove parents parameter to workingctx
it was needed before the refactor of commit, workingctx always uses the
dirstate now.
2010-04-21 01:18:31 +02:00
Steve Losh
8551e0d0f2 commands: add more robust support for 'hg log -b' (issue2078)
Fixes issue2078 and adds tests to cover various 'hg log -b' uses.

This change adds a localrepo.lookupbranch(key, remote=None) function. This
will look up the branch of the revision with the given key. The algorithm
works like this:

    * If a remote repo is given and KEY is the name of a branch in that repo,
      return KEY.
    * If no remote repo is given and KEY is the name of a branch in the local
      repo object, return KEY.
    * Otherwise look up the revision with the identifier KEY in the local repo
      and return its branch.

This change also makes 'hg log -b' use this new functionality and adds a few
tests for it.
2010-04-12 19:33:25 -04:00
Sune Foldager
3a5dc74781 merge with stable 2010-04-15 22:34:26 +02:00
Sune Foldager
a81e6a76a5 prepush: rewrite most of the code from scratch
For servers with branchmap support, the algorithm now works as follows:

1. A list of branches in outgoing changesets is created.
2. Using the remote branchmap, a check for new branches is performed.
3. A map (from branch to head list) of locally known remote heads before
   the push is created, and one which, after step 4, will contain the locally
   known remote heads after the push.
4. The post-push head map is updated with the outgoing changesets, using the
   branch cache update mechanism.
5. A check for new heads is performed, by comparing the length of the head list
   before and after push, for each branch. If there are new heads, an error
   depending on whether or not there are incoming changes on the branch,
   is returned.
6. If the push is allowed, a warning is written if there are incoming changes
   on any branches involved in the push.

For old servers, an algorithm similar to step 4-6 above is used to check for
new topological heads only.

Two bugs are also fixed:
1. Sometimes you would be allowed to push new branch heads without --force.
   A test for this case was added.
2. You would get the "note: unsynced remote changes!" warning if there were any
   incoming changesets, even if they were on unrelated branches.
2010-04-15 21:59:21 +02:00