Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 4059:431f3c1d3a37
Merge with crew-stable
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 30 Jan 2007 19:36:56 -0200 |
parents | 1bd6868b0b11 f1622b4f467d |
children | 5b1f663ef86d |
comparison
equal
deleted
inserted
replaced
4051:022056263354 | 4059:431f3c1d3a37 |
---|---|
602 else: | 602 else: |
603 res = lambda p: dest | 603 res = lambda p: dest |
604 return res | 604 return res |
605 | 605 |
606 | 606 |
607 pats = list(pats) | 607 pats = util.expand_glob(pats) |
608 if not pats: | 608 if not pats: |
609 raise util.Abort(_('no source or destination specified')) | 609 raise util.Abort(_('no source or destination specified')) |
610 if len(pats) == 1: | 610 if len(pats) == 1: |
611 raise util.Abort(_('no destination specified')) | 611 raise util.Abort(_('no destination specified')) |
612 dest = pats.pop() | 612 dest = pats.pop() |
619 else: | 619 else: |
620 tfn = targetpathfn | 620 tfn = targetpathfn |
621 copylist = [] | 621 copylist = [] |
622 for pat in pats: | 622 for pat in pats: |
623 srcs = [] | 623 srcs = [] |
624 for tag, abssrc, relsrc, exact in cmdutil.walk(repo, [pat], opts): | 624 for tag, abssrc, relsrc, exact in cmdutil.walk(repo, [pat], opts, |
625 globbed=True): | |
625 origsrc = okaytocopy(abssrc, relsrc, exact) | 626 origsrc = okaytocopy(abssrc, relsrc, exact) |
626 if origsrc: | 627 if origsrc: |
627 srcs.append((origsrc, abssrc, relsrc, exact)) | 628 srcs.append((origsrc, abssrc, relsrc, exact)) |
628 if not srcs: | 629 if not srcs: |
629 continue | 630 continue |
767 repo.dirstate.read() | 768 repo.dirstate.read() |
768 dc = repo.dirstate.map | 769 dc = repo.dirstate.map |
769 keys = dc.keys() | 770 keys = dc.keys() |
770 keys.sort() | 771 keys.sort() |
771 for file_ in keys: | 772 for file_ in keys: |
773 if dc[file_][3] == -1: | |
774 # Pad or slice to locale representation | |
775 locale_len = len(time.strftime("%x %X", time.localtime(0))) | |
776 timestr = 'unset' | |
777 timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) | |
778 else: | |
779 timestr = time.strftime("%x %X", time.localtime(dc[file_][3])) | |
772 ui.write("%c %3o %10d %s %s\n" | 780 ui.write("%c %3o %10d %s %s\n" |
773 % (dc[file_][0], dc[file_][1] & 0777, dc[file_][2], | 781 % (dc[file_][0], dc[file_][1] & 0777, dc[file_][2], |
774 time.strftime("%x %X", | 782 timestr, file_)) |
775 time.localtime(dc[file_][3])), file_)) | |
776 for f in repo.dirstate.copies(): | 783 for f in repo.dirstate.copies(): |
777 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f)) | 784 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f)) |
778 | 785 |
779 def debugdata(ui, file_, rev): | 786 def debugdata(ui, file_, rev): |
780 """dump the contents of an data file revision""" | 787 """dump the contents of an data file revision""" |
2476 """apply a changegroup file | 2483 """apply a changegroup file |
2477 | 2484 |
2478 Apply a compressed changegroup file generated by the bundle | 2485 Apply a compressed changegroup file generated by the bundle |
2479 command. | 2486 command. |
2480 """ | 2487 """ |
2481 gen = changegroup.readbundle(urllib.urlopen(fname), fname) | 2488 if os.path.exists(fname): |
2489 f = open(fname) | |
2490 else: | |
2491 f = urllib.urlopen(fname) | |
2492 gen = changegroup.readbundle(f, fname) | |
2482 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) | 2493 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) |
2483 return postincoming(ui, repo, modheads, opts['update']) | 2494 return postincoming(ui, repo, modheads, opts['update']) |
2484 | 2495 |
2485 def update(ui, repo, node=None, clean=False, date=None): | 2496 def update(ui, repo, node=None, clean=False, date=None): |
2486 """update working directory | 2497 """update working directory |