Show More
@@ -425,11 +425,18 b' class histeditaction(object):' | |||||
425 | def fromrule(cls, state, rule): |
|
425 | def fromrule(cls, state, rule): | |
426 | """Parses the given rule, returning an instance of the histeditaction. |
|
426 | """Parses the given rule, returning an instance of the histeditaction. | |
427 | """ |
|
427 | """ | |
428 |
rule |
|
428 | ruleid = rule.strip().split(' ', 1)[0] | |
|
429 | # ruleid can be anything from rev numbers, hashes, "bookmarks" etc | |||
|
430 | # Check for validation of rule ids and get the rulehash | |||
429 | try: |
|
431 | try: | |
430 |
rev = node.bin(rule |
|
432 | rev = node.bin(ruleid) | |
431 | except TypeError: |
|
433 | except TypeError: | |
432 | raise error.ParseError("invalid changeset %s" % rulehash) |
|
434 | try: | |
|
435 | _ctx = scmutil.revsingle(state.repo, ruleid) | |||
|
436 | rulehash = _ctx.hex() | |||
|
437 | rev = node.bin(rulehash) | |||
|
438 | except error.RepoLookupError: | |||
|
439 | raise error.ParseError("invalid changeset %s" % ruleid) | |||
433 | return cls(state, rev) |
|
440 | return cls(state, rev) | |
434 |
|
441 | |||
435 | def verify(self, prev, expected, seen): |
|
442 | def verify(self, prev, expected, seen): |
@@ -236,10 +236,10 b' Test bogus rev' | |||||
236 |
|
236 | |||
237 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
237 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
238 | > pick eb57da33312f 2 three |
|
238 | > pick eb57da33312f 2 three | |
239 | > pick 0 |
|
239 | > pick 0u98 | |
240 | > pick 08d98a8350f3 4 five |
|
240 | > pick 08d98a8350f3 4 five | |
241 | > EOF |
|
241 | > EOF | |
242 | hg: parse error: invalid changeset 0 |
|
242 | hg: parse error: invalid changeset 0u98 | |
243 | [255] |
|
243 | [255] | |
244 |
|
244 | |||
245 | Test short version of command |
|
245 | Test short version of command | |
@@ -552,3 +552,39 b" Check that 'roll' is selected by default" | |||||
552 | # |
|
552 | # | |
553 |
|
553 | |||
554 | $ cd .. |
|
554 | $ cd .. | |
|
555 | ||||
|
556 | Check that histedit's commands accept revsets | |||
|
557 | $ hg init bar | |||
|
558 | $ cd bar | |||
|
559 | $ echo w >> a | |||
|
560 | $ hg ci -qAm "adds a" | |||
|
561 | $ echo x >> b | |||
|
562 | $ hg ci -qAm "adds b" | |||
|
563 | $ echo y >> c | |||
|
564 | $ hg ci -qAm "adds c" | |||
|
565 | $ echo z >> d | |||
|
566 | $ hg ci -qAm "adds d" | |||
|
567 | $ hg log -G -T '{rev} {desc}\n' | |||
|
568 | @ 3 adds d | |||
|
569 | | | |||
|
570 | o 2 adds c | |||
|
571 | | | |||
|
572 | o 1 adds b | |||
|
573 | | | |||
|
574 | o 0 adds a | |||
|
575 | ||||
|
576 | $ HGEDITOR=cat hg histedit "2" --commands - << EOF | |||
|
577 | > base -4 adds c | |||
|
578 | > pick 2 adds c | |||
|
579 | > pick tip adds d | |||
|
580 | > EOF | |||
|
581 | $ hg log -G -T '{rev} {desc}\n' | |||
|
582 | @ 5 adds d | |||
|
583 | | | |||
|
584 | o 4 adds c | |||
|
585 | | | |||
|
586 | | o 1 adds b | |||
|
587 | |/ | |||
|
588 | o 0 adds a | |||
|
589 | ||||
|
590 |
General Comments 0
You need to be logged in to leave comments.
Login now