diff -r 40ac468c2558 -r 4af57f97c1bc Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py --- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py Sat Apr 17 16:20:11 2010 +0000 +++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py Sat Apr 17 16:43:18 2010 +0000 @@ -38,11 +38,12 @@ MessageColumn = 5 TagsColumn = 6 - def __init__(self, vcs, parent = None): + def __init__(self, vcs, mode = "log", parent = None): """ Constructor @param vcs reference to the vcs object + @param mode mode of the dialog (string; one of log, incoming, outgoing) @param parent parent widget (QWidget) """ QDialog.__init__(self, parent) @@ -55,6 +56,10 @@ self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder) self.vcs = vcs + if mode in ("log", "incoming", "outgoing"): + self.mode = mode + else: + self.mode = "log" self.__maxDate = QDate() self.__minDate = QDate() @@ -371,12 +376,14 @@ self.inputGroup.show() args = [] - args.append('log') + args.append(self.mode) self.vcs.addArguments(args, self.vcs.options['global']) self.vcs.addArguments(args, self.vcs.options['log']) args.append('--verbose') args.append('--limit') args.append(str(self.limitSpinBox.value())) + if self.mode in ("incoming", "outgoing"): + args.append("--newest-first") if startRev is not None: args.append('--rev') args.append('{0}:0'.format(startRev)) @@ -472,6 +479,7 @@ noEntries = 0 log = {"message" : []} changedPaths = [] + initialText = True for s in self.buf: if s != "@@@\n": try: @@ -480,6 +488,7 @@ key = "" value = s if key == "change": + initialText = False log["revision"] = value.strip() elif key == "user": log["author"] = value.strip() @@ -519,6 +528,8 @@ elif key == "tags": log["tags"] = value.strip().split() else: + if initialText: + continue if value.strip(): log["message"].append(value.strip()) else: