Come io sono su Windows, ho creato un piccolo script fare la stessa cosa in PERL, piuttosto che Shell, PowerShell o px :):
#*******************************************************************************
# Module: delete_empty_changelist.pl
# Purpose: A script to delete empty changelist
#
@list = `p4 changes -s submitted`;
foreach $chg (@list)
{
$chgnbr = (split /\s+/, $chg)[1];
print `p4 change -d -f $chgnbr`;
}
exit 0;
Si noti che in realtà , in tutti i casi, non è uno script molto intelligente: tenta di eliminare assolutamente ogni elenco di modifiche presentato, ed è impedito per forza di farlo, perché se i file sono associati con esso, si otterrà un errore.
Suppongo che il risultato dello script debba essere inviato a un log e analizzato, in modo che vengano evidenziate solo le righe pertinenti.
Esecuzione dello script produrrà un output simile a:
Change 857 has 1 files associated with it and can't be deleted.
Change 856 has 1 fixes associated with it and can't be deleted.
Change 855 has 1 fixes associated with it and can't be deleted.
Change 854 deleted.
Change 853 has 1 fixes associated with it and can't be deleted.
Change 852 has 8 files associated with it and can't be deleted.
Change 851 has 1 files associated with it and can't be deleted.
Change 850 has 2 files associated with it and can't be deleted.
Change 849 has 2 files associated with it and can't be deleted.
Change 846 deleted.
Change 845 has 2 files associated with it and can't be deleted.
Cheers,
Thomas
fonte
2009-10-16 14:54:03
È necessario accettare la propria risposta (per contrassegnare la domanda come risposta). :-) – PhiLho
Non ho potuto utilizzare le risposte proposte sul mio PC Windows, quindi ho scritto un piccolo script PERL per fare lo stesso. :-) –