Show More
@@ -415,7 +415,9 ENVIRONMENT VARIABLES | |||||
415 |
|
415 | |||
416 | HGEDITOR:: |
|
416 | HGEDITOR:: | |
417 | This is the name of the editor to use when committing. Defaults to the |
|
417 | This is the name of the editor to use when committing. Defaults to the | |
418 | value of EDITOR. |
|
418 | value of EDITOR. | |
|
419 | ||||
|
420 | (deprecated, use .hgrc) | |||
419 |
|
421 | |||
420 | HGMERGE:: |
|
422 | HGMERGE:: | |
421 | An executable to use for resolving merge conflicts. The program |
|
423 | An executable to use for resolving merge conflicts. The program | |
@@ -425,9 +427,13 HGMERGE:: | |||||
425 | The default program is "hgmerge", which is a shell script provided |
|
427 | The default program is "hgmerge", which is a shell script provided | |
426 | by Mercurial with some sensible defaults. |
|
428 | by Mercurial with some sensible defaults. | |
427 |
|
429 | |||
|
430 | (deprecated, use .hgrc) | |||
|
431 | ||||
428 | HGUSER:: |
|
432 | HGUSER:: | |
429 | This is the string used for the author of a commit. |
|
433 | This is the string used for the author of a commit. | |
430 |
|
434 | |||
|
435 | (deprecated, use .hgrc) | |||
|
436 | ||||
431 | EMAIL:: |
|
437 | EMAIL:: | |
432 | If HGUSER is not set, this will be used as the author for a commit. |
|
438 | If HGUSER is not set, this will be used as the author for a commit. | |
433 |
|
439 | |||
@@ -458,6 +464,21 FILES | |||||
458 | This file contains defaults and configuration. Values in .hg/hgrc |
|
464 | This file contains defaults and configuration. Values in .hg/hgrc | |
459 | override those in .hgrc. |
|
465 | override those in .hgrc. | |
460 |
|
466 | |||
|
467 | ||||
|
468 | UI OPTIONS | |||
|
469 | ---------- | |||
|
470 | ||||
|
471 | Various configuration options can be set in .hgrc: | |||
|
472 | ||||
|
473 | ------------- | |||
|
474 | [ui] | |||
|
475 | verbose = 0 | |||
|
476 | username = Matt Mackall <mpm@selenic.com> | |||
|
477 | editor = hgeditor | |||
|
478 | merge = hgmerge | |||
|
479 | ------------- | |||
|
480 | ||||
|
481 | ||||
461 | NAMED REPOSITORIES |
|
482 | NAMED REPOSITORIES | |
462 | ------------------ |
|
483 | ------------------ | |
463 |
|
484 |
@@ -14,9 +14,6 def fancyopts(args, options, state): | |||||
14 | if s: short = short + s |
|
14 | if s: short = short + s | |
15 | if l: long.append(l) |
|
15 | if l: long.append(l) | |
16 |
|
16 | |||
17 | if os.environ.has_key("HG_OPTS"): |
|
|||
18 | args = os.environ["HG_OPTS"].split() + args |
|
|||
19 |
|
||||
20 | opts, args = getopt.getopt(args, short, long) |
|
17 | opts, args = getopt.getopt(args, short, long) | |
21 |
|
18 | |||
22 | for opt, arg in opts: |
|
19 | for opt, arg in opts: |
@@ -161,12 +161,6 class changelog(revlog): | |||||
161 |
|
161 | |||
162 | def add(self, manifest, list, desc, transaction, p1=None, p2=None, |
|
162 | def add(self, manifest, list, desc, transaction, p1=None, p2=None, | |
163 | user=None, date=None): |
|
163 | user=None, date=None): | |
164 | user = (user or |
|
|||
165 | os.environ.get("HGUSER") or |
|
|||
166 | os.environ.get("EMAIL") or |
|
|||
167 | (os.environ.get("LOGNAME", |
|
|||
168 | os.environ.get("USERNAME", "unknown")) |
|
|||
169 | + '@' + socket.getfqdn())) |
|
|||
170 | date = date or "%d %d" % (time.time(), time.timezone) |
|
164 | date = date or "%d %d" % (time.time(), time.timezone) | |
171 | list.sort() |
|
165 | list.sort() | |
172 | l = [hex(manifest), user, date] + list + ["", desc] |
|
166 | l = [hex(manifest), user, date] + list + ["", desc] | |
@@ -592,6 +586,7 class localrepository: | |||||
592 | pass |
|
586 | pass | |
593 |
|
587 | |||
594 | mnode = self.manifest.add(mm, mfm, tr, linkrev, c1[0], c2[0]) |
|
588 | mnode = self.manifest.add(mm, mfm, tr, linkrev, c1[0], c2[0]) | |
|
589 | user = user or self.ui.username() | |||
595 | n = self.changelog.add(mnode, files, text, tr, p1, p2, user, date) |
|
590 | n = self.changelog.add(mnode, files, text, tr, p1, p2, user, date) | |
596 | tr.close() |
|
591 | tr.close() | |
597 | if update_dirstate: |
|
592 | if update_dirstate: | |
@@ -675,6 +670,7 class localrepository: | |||||
675 | return 1 |
|
670 | return 1 | |
676 | text = edittext |
|
671 | text = edittext | |
677 |
|
672 | |||
|
673 | user = user or self.ui.username() | |||
678 | n = self.changelog.add(mn, new, text, tr, p1, p2, user, date) |
|
674 | n = self.changelog.add(mn, new, text, tr, p1, p2, user, date) | |
679 |
|
675 | |||
680 | if not self.hook("commit", node=hex(n)): |
|
676 | if not self.hook("commit", node=hex(n)): | |
@@ -1303,7 +1299,8 class localrepository: | |||||
1303 | self.ui.debug("file %s: other %s ancestor %s\n" % |
|
1299 | self.ui.debug("file %s: other %s ancestor %s\n" % | |
1304 | (fn, short(other), short(base))) |
|
1300 | (fn, short(other), short(base))) | |
1305 |
|
1301 | |||
1306 |
cmd = |
|
1302 | cmd = self.ui.config("ui", "merge") or \ | |
|
1303 | os.environ.get("HGMERGE", "hgmerge") | |||
1307 | r = os.system("%s %s %s %s" % (cmd, a, b, c)) |
|
1304 | r = os.system("%s %s %s %s" % (cmd, a, b, c)) | |
1308 | if r: |
|
1305 | if r: | |
1309 | self.ui.warn("merging %s failed!\n" % fn) |
|
1306 | self.ui.warn("merging %s failed!\n" % fn) |
@@ -41,6 +41,14 class ui: | |||||
41 | return self.cdata.items(section) |
|
41 | return self.cdata.items(section) | |
42 | return [] |
|
42 | return [] | |
43 |
|
43 | |||
|
44 | def username(self): | |||
|
45 | return (self.config("ui", "username") or | |||
|
46 | os.environ.get("HGUSER") or | |||
|
47 | os.environ.get("EMAIL") or | |||
|
48 | (os.environ.get("LOGNAME", | |||
|
49 | os.environ.get("USERNAME", "unknown")) | |||
|
50 | + '@' + socket.getfqdn())) | |||
|
51 | ||||
44 | def expandpath(self, loc): |
|
52 | def expandpath(self, loc): | |
45 | paths = {} |
|
53 | paths = {} | |
46 | for name, path in self.configitems("paths"): |
|
54 | for name, path in self.configitems("paths"): | |
@@ -83,7 +91,10 class ui: | |||||
83 | f.write(text) |
|
91 | f.write(text) | |
84 | f.close() |
|
92 | f.close() | |
85 |
|
93 | |||
86 | editor = os.environ.get("HGEDITOR") or os.environ.get("EDITOR", "vi") |
|
94 | editor = (self.config("ui", "editor") or | |
|
95 | os.environ.get("HGEDITOR") or | |||
|
96 | os.environ.get("EDITOR", "vi")) | |||
|
97 | ||||
87 | util.system("%s %s" % (editor, name), errprefix = "edit failed") |
|
98 | util.system("%s %s" % (editor, name), errprefix = "edit failed") | |
88 |
|
99 | |||
89 | t = open(name).read() |
|
100 | t = open(name).read() |
General Comments 0
You need to be logged in to leave comments.
Login now