Changeset 11004


Ignore:
Timestamp:
03/07/06 02:14:04 (15 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/Darcs.java

    r10998 r11004  
    33 *
    44 * Copyright (C) 2005-2006 Peter Graves
    5  * $Id: Darcs.java,v 1.2 2006-02-23 16:08:23 piso Exp $
     5 * $Id: Darcs.java,v 1.3 2006-03-07 02:14:04 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2222package org.armedbear.j;
    2323
    24 import gnu.regexp.RE;
    25 import gnu.regexp.REMatch;
    26 import gnu.regexp.UncheckedRE;
    27 import java.util.ArrayList;
    28 import java.util.Iterator;
    2924import java.util.List;
    3025import javax.swing.SwingUtilities;
    31 import javax.swing.undo.CompoundEdit;
    3226
    3327public class Darcs implements Constants
     
    4539    editor.setWaitCursor();
    4640    List args = Utilities.tokenize(s);
     41    String arg;
    4742    FastStringBuffer sb = new FastStringBuffer("darcs ");
    48     for (Iterator it = args.iterator(); it.hasNext();)
     43    for (int i = 0; i < args.size(); i++)
    4944      {
    50         String arg = (String) it.next();
    51         if (arg.equals("%"))
    52           {
    53             File file = editor.getBuffer().getFile();
    54             if (file != null)
    55               arg = file.canonicalPath();
    56           }
     45        arg = (String) args.get(i);
     46        if (i == 0 && arg.equals("w"))
     47          arg = "whatsnew";
    5748        sb.append(maybeQuote(arg));
    5849        sb.append(' ');
     50      }
     51    if (sb.toString().equals("darcs whatsnew "))
     52      {
     53        File file = editor.getBuffer().getFile();
     54        if (file != null)
     55          sb.append(file.getName());
    5956      }
    6057    final String cmd = sb.toString().trim();
Note: See TracChangeset for help on using the changeset viewer.