Index: trunk/src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 4413)
+++ trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 4414)
@@ -10,4 +10,5 @@
 
 import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
 
 import org.openstreetmap.josm.Main;
@@ -147,5 +148,5 @@
      * @param apiData the primitives to be added, updated, or deleted
      */
-    public void uploadData(OsmDataLayer layer, APIDataSet apiData) {
+    public void uploadData(final OsmDataLayer layer, APIDataSet apiData) {
         if (apiData.isEmpty()) {
             JOptionPane.showMessageDialog(
@@ -161,4 +162,14 @@
 
         final UploadDialog dialog = UploadDialog.getUploadDialog();
+        // If we simply set the changeset comment here, it would be
+        // overridden by subsequent events in EDT that are caused by
+        // dialog creation. The current solution is to queue this operation
+        // after these events.
+        // TODO: find better way to initialize the comment field
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                dialog.setDefaultChangesetTags(layer.data.getChangeSetTags());
+            }
+        });
         dialog.setUploadedPrimitives(apiData);
         dialog.setVisible(true);
Index: trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 4413)
+++ trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 4414)
@@ -81,5 +81,5 @@
  * Note that it is not necessary to call beginUpdate/endUpdate for every dataset modification - dataset will get locked
  * automatically.
- * 
+ *
  * Note that locks cannot be upgraded - if one threads use read lock and and then write lock, dead lock will occur - see #5814 for
  * sample ticket
@@ -205,4 +205,17 @@
     public void setVersion(String version) {
         this.version = version;
+    }
+
+    /*
+    * Holding bin for changeset tag information, to be applied when or if this is ever uploaded.
+    */
+    private Map<String, String> changeSetTags = new HashMap<String, String>();
+
+    public Map<String, String> getChangeSetTags() {
+        return changeSetTags;
+    }
+
+    public void addChangeSetTag(String k, String v) {
+        this.changeSetTags.put(k,v);
     }
 
@@ -438,5 +451,5 @@
      * nodes should be highlighted. WaySegments are used to avoid having
      * to create a VirtualNode class that wouldn't have much purpose otherwise.
-     * 
+     *
      * @return unmodifiable collection of WaySegments
      */
@@ -448,5 +461,5 @@
      * returns an unmodifiable collection of WaySegments that should be
      * highlighted.
-     * 
+     *
      * @return unmodifiable collection of WaySegments
      */
@@ -1056,5 +1069,5 @@
     /**
      * Invalidates the internal cache of projected east/north coordinates.
-     * 
+     *
      * This method can be invoked after the globally configured projection method
      * changed. In contrast to {@link DataSet#reproject()} it only invalidates the
@@ -1143,11 +1156,11 @@
     /**
      * <p>Replies the list of data source bounds.</p>
-     * 
+     *
      * <p>Dataset maintains a list of data sources which have been merged into the
      * data set. Each of these sources can optionally declare a bounding box of the
      * data it supplied to the dataset.</p>
-     * 
+     *
      * <p>This method replies the list of defined (non {@code null}) bounding boxes.</p>
-     * 
+     *
      * @return the list of data source bounds. An empty list, if no non-null data source
      * bounds are defined.
Index: trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java	(revision 4413)
+++ trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java	(revision 4414)
@@ -9,5 +9,5 @@
  *
  */
-public class ChangesetCommentModel extends Observable{
+public class ChangesetCommentModel extends Observable {
     private String comment = "";
 
@@ -18,5 +18,5 @@
      * @param comment the new upload comment. Empty string assumed if null.
      */
-    public void setComment(String comment){
+    public void setComment(String comment) {
         String oldValue = this.comment;
         this.comment = comment == null ? "" : comment;
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 4413)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 4414)
@@ -301,4 +301,9 @@
     public void setDefaultChangesetTags(Map<String, String> tags) {
         pnlTagSettings.setDefaultTags(tags);
+         for (String key: tags.keySet()) { 
+            if (key.equals("comment")) { 
+                changesetCommentModel.setComment(tags.get(key));
+            } 
+        } 
     }
 
Index: trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 4413)
+++ trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 4414)
@@ -24,4 +24,5 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.DataSource;
@@ -36,4 +37,5 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
+import org.openstreetmap.josm.data.osm.Tagged;
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.data.osm.Way;
@@ -86,4 +88,6 @@
     private Map<Long, Collection<RelationMemberData>> relations = new HashMap<Long, Collection<RelationMemberData>>();
 
+    private Changeset uploadChangeset;
+
     /**
      * constructor (for private use only)
@@ -141,6 +145,10 @@
             throwException(tr("Unsupported version: {0}", v));
         }
+        ds.setVersion(v);
         String generator = parser.getAttributeValue(null, "generator");
-        ds.setVersion(v);
+        Long uploadChangesetId = null;
+        if (parser.getAttributeValue(null, "upload-changeset") != null) {
+            uploadChangesetId = getLong("upload-changeset");
+        }
         while (true) {
             int event = parser.next();
@@ -154,4 +162,6 @@
                 } else if (parser.getLocalName().equals("relation")) {
                     parseRelation();
+                } else if (parser.getLocalName().equals("changeset")) {
+                    parseChangeset(uploadChangesetId);
                 } else {
                     parseUnkown();
@@ -320,5 +330,27 @@
     }
 
-    private void parseTag(OsmPrimitive osm) throws XMLStreamException {
+    private void parseChangeset(Long uploadChangesetId) throws XMLStreamException {
+        long id = getLong("id");
+
+        if (id == uploadChangesetId) {
+            uploadChangeset = new Changeset((int) getLong("id"));
+            while (true) {
+                int event = parser.next();
+                if (event == XMLStreamConstants.START_ELEMENT) {
+                    if (parser.getLocalName().equals("tag")) {
+                        parseTag(uploadChangeset);
+                    } else {
+                        parseUnkown();
+                    }
+                } else if (event == XMLStreamConstants.END_ELEMENT) {
+                    return;
+                }
+            }
+        } else {
+            jumpToEnd(false);
+        }
+    }
+
+    private void parseTag(Tagged t) throws XMLStreamException {
         String key = parser.getAttributeValue(null, "k");
         String value = parser.getAttributeValue(null, "v");
@@ -326,28 +358,6 @@
             throwException(tr("Missing key or value attribute in tag."));
         }
-        osm.put(key.intern(), value.intern());
+        t.put(key.intern(), value.intern());
         jumpToEnd();
-    }
-
-    /**
-     * When cursor is at the start of an element, moves it to the end tag of that element.
-     * Nested content is skipped.
-     *
-     * This is basically the same code as parseUnkown(), except for the warnings, which
-     * are displayed for inner elements and not at top level.
-     */
-    private void jumpToEnd() throws XMLStreamException {
-        while (true) {
-            int event = parser.next();
-            if (event == XMLStreamConstants.START_ELEMENT) {
-                parseUnkown();
-            } else if (event == XMLStreamConstants.END_ELEMENT) {
-                return;
-            }
-        }
-    }
-
-    private void parseUnkown() throws XMLStreamException {
-        parseUnkown(true);
     }
 
@@ -364,4 +374,30 @@
             }
         }
+    }
+
+    private void parseUnkown() throws XMLStreamException {
+        parseUnkown(true);
+    }
+
+    /**
+     * When cursor is at the start of an element, moves it to the end tag of that element.
+     * Nested content is skipped.
+     *
+     * This is basically the same code as parseUnkown(), except for the warnings, which
+     * are displayed for inner elements and not at top level.
+     */
+    private void jumpToEnd(boolean printWarning) throws XMLStreamException {
+        while (true) {
+            int event = parser.next();
+            if (event == XMLStreamConstants.START_ELEMENT) {
+                parseUnkown(printWarning);
+            } else if (event == XMLStreamConstants.END_ELEMENT) {
+                return;
+            }
+        }
+    }
+
+    private void jumpToEnd() throws XMLStreamException {
+        jumpToEnd(true);
     }
 
@@ -665,4 +701,12 @@
     }
 
+    private void processChangesetAfterParsing() {
+        if (uploadChangeset != null) {
+            for (Map.Entry<String, String> e : uploadChangeset.getKeys().entrySet()) {
+                ds.addChangeSetTag(e.getKey(), e.getValue());
+            }
+        }
+    }
+
     /**
      * Parse the given input source and return the dataset.
@@ -697,4 +741,5 @@
                 reader.processWaysAfterParsing();
                 reader.processRelationsAfterParsing();
+                reader.processChangesetAfterParsing();
             } finally {
                 reader.ds.endUpdate();
